C
Cablewizard
This has been driving me nuts.
If I create a form, then change its location using the Location Property prior
to displaying it, the form changes size (shrinks).
For example:
Dim frm as New frmMyForm
frm.location = desiredLocation '<- If I remove this, form is fine, but in
wrong location
frm.showDialog() '<- form shrinks.
I have tried turning AutoScale on and off, no difference.
This happens on the development machine, all fonts and DPI settings are
standard.
There is no reason scaling should be taking place anyway.
Tried all the different StartPosition options, makes no difference (well yes it
alters the StartPosition, but form always shrinks)
After much frustration, the only ways to get around it that I have found are:
1. Set MinimumSize to desired size
2. Show the form centered in the screen and then move it. ugly.
3. Add an additional property to the form, such as StartLocation, then apply the
desired location in the Form Load Event.
In my opinion, this is a bug. Scaling is happening when it should not, contrary
to other settings explicitly telling it not to, i.e. AutoScale = False. I can
move the form at other times just fine, just not prior to displaying it.
Am I missing something?
Gerald
If I create a form, then change its location using the Location Property prior
to displaying it, the form changes size (shrinks).
For example:
Dim frm as New frmMyForm
frm.location = desiredLocation '<- If I remove this, form is fine, but in
wrong location
frm.showDialog() '<- form shrinks.
I have tried turning AutoScale on and off, no difference.
This happens on the development machine, all fonts and DPI settings are
standard.
There is no reason scaling should be taking place anyway.
Tried all the different StartPosition options, makes no difference (well yes it
alters the StartPosition, but form always shrinks)
After much frustration, the only ways to get around it that I have found are:
1. Set MinimumSize to desired size
2. Show the form centered in the screen and then move it. ugly.
3. Add an additional property to the form, such as StartLocation, then apply the
desired location in the Form Load Event.
In my opinion, this is a bug. Scaling is happening when it should not, contrary
to other settings explicitly telling it not to, i.e. AutoScale = False. I can
move the form at other times just fine, just not prior to displaying it.
Am I missing something?
Gerald