WinForm sizing problem in different computers

L

lamxing

Hi,

I've come across a strange problem with the WinForm's sizing.
I've designed a WinForm and it runs fine on my computer and some other
PCs. But when I was trying to run the app under some PCs with wide
screen, some of my controls on the WinForm will automatic resize
themselves to be bigger and thus push other controls off the screen.
For a sample of this problem, please see http://usctimes.com/screen.jpg
.. The screen on the left is what it normally look like in my PC, and
the screen on the right is what it looks like on the problematic PCs.
Notices that the red retangle part of the controls were pushed off the
screen. I've tried changing the font DPI settings on the problematic
PCs, but the result is still the same. I've also tried various Anchor
options, but it won't solve the problem.

I'm using VS 2005 running .Net 2.0 on my project. Any help is
greatly appreciated!
 
V

VJ

Hello,

Did you also try looking at Dock property. Anchor and Dock go hand in hand
for such issues. Normal such issues happen when you design screens at higher
resloution and take it to PCs with lower resloutions like a 800X600 and
yours looks very similar.

Let me know if you still have issues!
VJ
 
L

lamxing

Hi VJ,

Thanks for your tips. Actually I designed the layout in
800x600 and the above issue happens when I use the program in a
machine that has 1280x768. The cut off controls are all have docking
setting set to "None", and Anchored to their closest panel edge (e.g.
the controls that are closer to the left edge of the panel is Anchored
to the left & top, the controls that are closer to the right edge of
the panel is Ancored to the right & top, etc...). I've also tried
changing the screen resolution to the exact same resolution as the
problematic PC in my development machine, but the software functioned
correctly on my machine.

It seems that text in the controls are all enlarged thus made
the buttons too big to fit in the fixed sized panel. See
http://usctimes.com/screen2.jpg . The lower screens are the the
correct result. The Anchor settings are as follow:
Title label and textbox : Left, Top
Group label, dropdown, and New Group Button: right, top
Description label, textbox: left, bottom
Search Key: right, bottom

Thanks for any tips!
 
L

lamxing

Upon further testing, I found that the problem is due to the font DPI
setting. After I've set the Font DPI setting to Large(120%) and
REBOOT the computer (I did not reboot on previous trials), the problem
happened in my development PC as well. Is there anyway to force the
DPI settings to normal on the application?
 
V

VJ

You are saying you set resloution as needed in your PC, designed windows
and controls. Now ran the application it on client machine with same
resloution, and still had it issues?

There is also a AutoScale, AutoSize (If available and supported by the
control). That can be used to control or Windows appearance. Please do read
about them understand the effects of these and make changes. MSDN
documentation is really good on these topics

VJ
 
P

Peter Duniho

[...]Is there anyway to force the
DPI settings to normal on the application?

Not really, and there are good reasons for not forcing your own idea of
"correct size" on the user anyway.

Instead, you should work harder to allow your application to deal with in
a user-friendly manner the USER's own choice in how they want (or in many
cases, need) their computer to look.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top