views:

298

answers:

1

I currently use a VMware virtual machine (Windows XP) to debug my .NET WinForms applications under 120dpi. Very annoying.

Does anybody know a way that gives me similar results under my 96dpi working environment? That is, can 120dpi mode be activated for a single process, or is there a switch in Windows Forms?

A: 

You can use Form Font property. By default WinForm form scale itself when Font property changed, something like that:

protected override void OnLoad(EventArgs e)
{
    base.OnLoad(e);
    Font = new Font("Arial", 14);
}

Don't forget to read about AutoScaleMode property and in general about autoscaling in MSDN.

arbiter
AutoScaleMode is set to Dpi. This is intended. So changing the font's size won't help.
Stefan Schultze
As far as I know this is the only way to test application in high-dpi-like environment. I use this metodique for test my applications on working machine, prior to testing on high-dpi virtual machine.
arbiter