Click here to Skip to main content
15,885,546 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralGreetings from 2021 Pin
Peter_in_278031-Dec-20 2:00
professionalPeter_in_278031-Dec-20 2:00 
GeneralRe: Greetings from 2021 Pin
Slacker00731-Dec-20 2:10
professionalSlacker00731-Dec-20 2:10 
GeneralRe: Greetings from 2021 Pin
W Balboos, GHB31-Dec-20 3:09
W Balboos, GHB31-Dec-20 3:09 
GeneralRe: Greetings from 2021 Pin
Mike Hankey31-Dec-20 3:18
mveMike Hankey31-Dec-20 3:18 
GeneralRe: Greetings from 2021 Pin
Jerigo31-Dec-20 5:00
Jerigo31-Dec-20 5:00 
GeneralRe: Greetings from 2021 Pin
S Houghtelin31-Dec-20 5:41
professionalS Houghtelin31-Dec-20 5:41 
GeneralRe: Greetings from 2021 Pin
dandy7231-Dec-20 5:42
dandy7231-Dec-20 5:42 
GeneralThank you Microsoft, but WTE? Pin
Richard MacCutchan30-Dec-20 23:53
mveRichard MacCutchan30-Dec-20 23:53 
When working on a WinForms app in Visual Studio, the following information notice is displayed at the top of the design Window.

Scaling on your main display is set to 125% Restart with scaling set to 100% Help me decide

I never really took much notice of it, but just thought how nice of Microsoft to make things visually clearer. But recently I discovered a quirk in this that can easily catch you out.

I wanted to add a dynamic control to a Windows form at run time, and I wanted it the same size as an existing control and positioned alongside it at the same vertical location. Easy enough, drop another control on the form in the designer and make a note of the location and size in the Properties Window.

All fine and dandy, but when I ran the app the dynamic control was mis-positioned and too large. Hmm, I wrote some numbers down incorrectly (a common problem at my age). So, back to the designer and check the numbers, and sure enough they are all correct. So what is different about the runtime form and the design form? After a lot of head scratching and cursing, I put a property grid on the form to look at the controls' values. And lo and behold, the runtime values are smaller than the design values! The differences did not mean much and it took a while for me to realise the simple answer.

Not only does the designer show the form scaled to 125%, but it also updates the position and size values to reflect that scale factor. But when the form is run (at 100% scaling) the numbers are adjusted downwards. When all controls are positioned at design time it is not a problem, just when using the original numbers to do dynamic positioning.

Am I the only person to trip over this?
GeneralRe: Thank you Microsoft, but WTE? Pin
GuyThiebaut31-Dec-20 1:55
professionalGuyThiebaut31-Dec-20 1:55 
GeneralRe: Thank you Microsoft, but WTE? Pin
Richard MacCutchan31-Dec-20 2:14
mveRichard MacCutchan31-Dec-20 2:14 
GeneralRe: Thank you Microsoft, but WTE? Pin
GuyThiebaut31-Dec-20 2:19
professionalGuyThiebaut31-Dec-20 2:19 
GeneralRe: Thank you Microsoft, but WTE? Pin
Richard MacCutchan31-Dec-20 2:36
mveRichard MacCutchan31-Dec-20 2:36 
GeneralRe: Thank you Microsoft, but WTE? Pin
GuyThiebaut31-Dec-20 2:58
professionalGuyThiebaut31-Dec-20 2:58 
GeneralRe: Thank you Microsoft, but WTE? Pin
RickZeeland31-Dec-20 2:18
mveRickZeeland31-Dec-20 2:18 
GeneralRe: Thank you Microsoft, but WTE? Pin
honey the codewitch31-Dec-20 2:30
mvahoney the codewitch31-Dec-20 2:30 
GeneralI was sent this, and... Pin
OriginalGriff30-Dec-20 23:47
mveOriginalGriff30-Dec-20 23:47 
GeneralRe: I was sent this, and... Pin
Kornfeld Eliyahu Peter31-Dec-20 1:44
professionalKornfeld Eliyahu Peter31-Dec-20 1:44 
GeneralRe: I was sent this, and... Pin
trønderen31-Dec-20 3:52
trønderen31-Dec-20 3:52 
GeneralRe: I was sent this, and... Pin
DRHuff31-Dec-20 3:24
DRHuff31-Dec-20 3:24 
GeneralNot a programming question - a... er... um... lockdown question. Pin
Chris C-B30-Dec-20 22:59
Chris C-B30-Dec-20 22:59 
GeneralRe: Not a programming question - a... er... um... lockdown question. Pin
GenJerDan31-Dec-20 0:07
GenJerDan31-Dec-20 0:07 
GeneralRe: Not a programming question - a... er... um... lockdown question. Pin
Chris C-B31-Dec-20 1:07
Chris C-B31-Dec-20 1:07 
GeneralRe: Not a programming question - a... er... um... lockdown question. Pin
GenJerDan31-Dec-20 1:49
GenJerDan31-Dec-20 1:49 
GeneralRe: Not a programming question - a... er... um... lockdown question. Pin
Chris C-B31-Dec-20 2:29
Chris C-B31-Dec-20 2:29 
GeneralRe: Not a programming question - a... er... um... lockdown question. Pin
enhzflep3-Jan-21 5:21
enhzflep3-Jan-21 5:21 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.