Reputation: 7278
I have a WinForms application (developed in Win 7 64x) with a CheckBox control. I have set the AutoScaleMode
property of my form to "None". The form looks fine on my machine.
However, when I send the program to my colleague who is running Windows 8, the CheckBox text appears incomplete. I'm not sure what property of this control is causing this.
Upvotes: 1
Views: 94
Reputation: 244782
I'm not sure what property of this control is causing this.
Well obviously it is the AutoScaleMode property. Or, I suppose more accurately, it is the Size property.
Your colleague's machine has not only different sized controls, but also different sized text. You can see this clearly by comparing the screenshots. The checkbox control's allowed size is too small (not wide enough) to display the entire label, so it gets truncated and all you see are the first two letters of the label.
The solution is rather simple: make the control's area bigger. A better idea would be to let this resizing happen automatically by setting the AutoScaleMode property of your container form to something more sensible, like Text or DPI. This ensures it will not break when the user has a different DPI or font setting than you do on your machine.
Long-term, it is better to design your forms with a fluid layout using TableLayoutPanel or FlowLayoutPanel in conjunction with the Anchor and Dock properties. It is more work than drag-and-drop in the designer, but it produces much better results that scale in all environments.
Upvotes: 2