Setting control size in Millimeters

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello all,
I have a quick question (and hopefully easy) here.

How can I programmaticaly set the size of a control (in my case a panel) in
millimeters? I want to initially set the size of the panel to e.g. 210x210
millimeters, before the form actually shows up.

Thanks
 
This is difficult to achieve because many monitors incorrectly report the
DPI of the screen hardware or don't report it at-all so that the default of
96 DPI is used.

If the screen size is correctly reported you can calculate the sizes
according to the screen DPI but if it's the plain old 96 DPI you may have to
do some sort of a setup calibration at install time to get the fudge factor
you need to use.

--
Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.
 
Thanks for your response Bob. I kind of realized that myself while trying to
make it work.

Thanks anyway.
 
Back
Top