Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why are my dialog boxes too small on some (but not all) Windows7 computers?

I'm starting to test a Winforms (using VS2008) app on Windows 7, and am seeing a strange problem.

It ran fine on the first couple of Win7 installations, but on the next two, many of my dialogs are too small, clipping the content by about 30%.

The app was developed on WinXP, and have not seen this problem on any of the XP installations!

Just starting to investigate the problem - don't have any details on differences between the systems that work and those that don't yet.

Edit

According to Kate's comment to one of the answers, Win7 will sometimes change to a custom text size when a new monitor is installed. The machine with the problem has a big, widescreen monitor, and when we checked (Control Panel + Display + Custom Text Size) - sure enough - the custom text size was set to 125%. Setting it to 100% made the problem go away.

I was then able to replicate the problem on WinXP by setting the text size to 125%.

So the question now becomes - how do you ensure a Winforms app is "custom text size independent"?

/Edit

As suggested, here are some screen shots. 1st one is from a Windows 7 computer, 2nd one is from my WinXP development system.

Windows 7

Windows XP

like image 636
Tom Bushell Avatar asked Aug 08 '11 14:08

Tom Bushell


1 Answers

I had the same issue when a Win 7 user adjusted the default font size in "Control Panel\All Control Panel Items\Display"

When you have forms set to "Fixed Dialog" set the following properties on your form: .AutoScaleMode=Font .AutoSize=True .AutoSizeMode=GrowOnly so windows can resize your form based on the sizes of the child elements.

AutoScaleMode=Font AutoSize=True AutoSizeMode=GrowOnly

like image 115
mike Avatar answered Oct 16 '22 05:10

mike