Windows Develop Bookmark and Share   
 index > Windows Forms General > Testing for auto-size doing the right thing
 

Testing for auto-size doing the right thing

Is there a way to fake the Framework into thing that the user is running at 120 DPI (large) instead of 96 DPI (normal)? Having to reboot every time just to see that the layout is working correctly is a pain!

Are there any known bugs or gotcha's in autosizing?  I'm having a horrible time with a complicated dialog trying to figure out why some seem to work and some don't. It is more than just setting autosize true.

Suggestions please.

Regards,
Al
Al Christoph  Thursday, May 19, 2005 1:35 PM
You can manually scale via the following code on form,


// hack to workaround a bug
this.AutoScaleMode = AutoScaleMode.Inherit
this.Scale SizeF(1.5F, 1.5F));

 


In later drops (built after 6/2, we fixed this bug and you should be able to simply call Scale();
Erick Ellis  Friday, June 17, 2005 12:24 AM
I got the auto-sizing working quite nicely by switching to DPI from font (the default?) as the way to do the sizing.

However, the question remains is there a way to fake the system out so that it can be checked out  on the same box?

How about something like a load event whose code body is skipped at design time and sets a fake autosize factor?????

Regards
Al
Al Christoph  Thursday, May 19, 2005 6:12 PM
You can manually scale via the following code on form,


// hack to workaround a bug
this.AutoScaleMode = AutoScaleMode.Inherit
this.Scale SizeF(1.5F, 1.5F));

 


In later drops (built after 6/2, we fixed this bug and you should be able to simply call Scale();
Erick Ellis  Friday, June 17, 2005 12:24 AM

You can use google to search for other answers

Custom Search

More Threads

• hosting controls / forms across app domains (alternatives or thoughts)
• How to always show the ToolStrip overflow button
• DataGridView databound
• Form that Fades away
• Convert a string to datetime
• How to fire the MouseClick event of Child control in Collections on Enter Key?
• Adding a combobox to a datagridview
• Return UNC from a Mapped drive.
• Handle forms click event when any control clicked on top of the form
• Image recognition in .NET ?