Just to experiment a bit, I created a simple VB 2005 win app: 1 small form,
with some text and a close button in the lower right corner of the form, no
close box. Native resolution is 1600x1200 at 96 DPI. I created one EXE with
Font autoscaling and another with DPI autoscaling.
Then I just changed my DPI to 120 and rebooted. Well, the BOTH EXE versions
are missing the close button. in fact I can double-click on the title bar
(which has no system menu, min, max or close boxes), and this maximizes the
form ... and the Close button is STILL no where to be seen! What's up with
that ??
I can close the form with Alt-F4, but where the heck did the button go ?
Perplexed ...
[quoted text, click to view] "Emby" <emby@blaisesoft-xxx.com> wrote in message
news:u$bW1al%23GHA.1220@TK2MSFTNGP05.phx.gbl...
>I recently released an app that looks and works fine under any desktop
>resolution setting, but have discovered that if a user's machine has a DPI
>setting above the standard 96 DPI, my forms are distorted and some controls
>are even clipped, that is, off-screen. This is especially painful when the
>clipped control is the close button for a modal dialog, and extremely so if
>it's a dialog from which I've removed the "close box".
>
> One can certainly argue the merits of such a design decision, but why
> doesn't WinForms under VS8 (2005) properly handle the video settings of
> the client machine.
>
> To really handle this properly, it looks like I'd have to modify
> autogenerated code in the form.Designer.cs (or .vb) file, which is where
> controls are positioned and sized when they are instantiated on the form.
> Sure, I could patch things up in the OnLoad override, but strictly
> speaking, I think the code handling this issue belongs with the
> constructors and initializers in the InitializeComponent routine.
>
> Or have I missed something? Anyone have some guidance or opins on this?
>
> Ah, OK, so I've read the help topic titled "Automatic Scaling in Windows
> Forms", and it says that "Font" autoscaling is the default. I find it hard
> to understand why the default behavior would clip controls under different
> DPI conditions.
>
> Can anyone please explain this to me ??
>
> Thanks
>