Reputation: 1883
I have a form which have so many controls in an old winForms App the client said he's using low screen resolution to easily manage this form
and now he want the controls and there font size to be big regardless of the screen resolution
if it's not an easy process is there any thing i can start with ?
Upvotes: 1
Views: 1891
Reputation: 1870
Most winforms controls that display text have a FontHeight property which you can modify in order to set the permanent font height for that particular element. This is the most flexible solution where you can control which elements get the larger font treatment.
Upvotes: 0
Reputation: 941218
Put this in the form's OnLoad override or Load event handler:
this.Font = new Font(this.Font.FontFamily, 1.25f * this.Font.Size);
Which takes advantage of the built-in autoscaling as configured by the AutoScaleMode property. Whether that will keep the layout intact is a unguessable, you'll have to try.
Your customer can do this too by increasing the video adapter's DPI setting. On Vista and up, going past 125% (120 dpi) triggers compatible DPI scaling. Which makes the OS lie about the DPI setting and produces a larger window through bitmap scaling. Makes it fuzzy but big enough to be usable.
Upvotes: 4
Reputation: 835
You can change the style for each of the controls or you can create a style class and change your controls to consume it as shown in the following link: http://www.codeproject.com/KB/miscctrl/WinFormStyleSheet.aspx
Upvotes: 1