views:

46

answers:

3

Hi, i have a wierd problem that i need to work out how to resolve,

I have spent the last couple of weeks working on a project for work on my laptop, but when i open the program on one of the work pcs alot of the controls are the wrong size and over lap etc,

the differences between the machines is this:

Laptop:

Windows 7 Pro; Display - 1920*1040; Visiual Studio 2008; .net framework 3.5

Work Desktop:

windows xp pro; display: 1024*768; visual studio 2008; .net framework 3.5;

to discribe the problem better, i have a panel which i have set to be 300px wide, which has a label inside with the day and the day in the mm-DD-yyyy format, using arial and size 8 font.

On the laptop it all fits perfectly but on the desktop the panel seems smaller and the label only displays half the text.

That is just one of many problems, another is with colour system.control seems to be a completly different colour between systems ( altho i figure that to be a win7 vs xp problem)

What can i do to fix this? is it a windows version problem? ( i have xp on a vmware machine on my laptop so i could code and design in that)

is it a display problem? - this is a big problem for me as i only have 1 laptop and i think this problem could have caused me mark loss on my recent assignment for Uni ( i coded on laptop and never opened on a desktop untill today - so had no idea of this problem)

as usual any help is welcomed thanks

Alan

EDIT: I have found a solution of sorts for my particular problem, I discovered that my laptop was working on 125% on the dpi settings for visually impaired (no idea how..) so I have reset it back to 100% or 96Dpi Which has fixed my problems, and after chatting to a couple of other developers I know, they say that they tend to design for 96 dpi while leaving a little bit of white space around text to be safe. but then they don't tend to use c# much and mainly code all in c++ using QT framework.

Much thanks to the comments and answers received

Alan

A: 

Ensure you can resize your panel in Visual Studio with all of the controls inside it being repositioned and resized properly. You can use anchors to achieve this, or perhaps you should use a TableLayoutPanel control instead of a regular Panel.

Bernard
A: 

Change your setting for AutoScaleMode.

Ben Voigt
+1  A: 

The video adapter in your workstation has a different dots-per-inch setting. The form automatically rescales itself to accommodate that.

This is going to happen as well when you ship your product and it will run on the client's machine. Changing the form's AutoScaleMode property is not a fix, that will just produce clipped text in the controls. Make sure you form design is resilient to layout changes. Dock, Anchor, TableLayoutPanel, FlowLayoutPanel, the Resize event for tough cases. And make sure the controls inherit their container's Font property (not bold in the Properties window)

Hans Passant