views:

173

answers:

2

Using C#, how would I convert from dialog units (used in resource files to specify height/width) to pixels?

A: 

Wow... I wrote this article 12 years ago....

http://noveltheory.com/TechPapers/dialog_units.htm

James Curran
Thats the concept I'm looking for. Is it available in C# anywhere?
John
Actually, this particular example works only when your dialog uses the "System" font, which is no longer the default font for dialogs. see http://msdn.microsoft.com/en-us/library/ms645475(VS.85).aspx
John Knoeller
A: 

There's a WinAPI function to map dialog units to pixels.

http://msdn.microsoft.com/en-us/library/ms645502.aspx

Janusz Lenar
Actually, there's also MFC wrapper:http://msdn.microsoft.com/en-us/library/1hb7x4ze.aspx
Janusz Lenar