I thought this would take 5 minutes. Spent 3 hours and haven't figured it out...
I have an MDI application and would like an easy way for the user to make it full screen without maximizing it, so I added a Windows/Full Screen menu option and put in this code to handle it:
Me.Left = 0
Me.Top = 0
Me.Width = Screen.PrimaryScreen.WorkingArea.Width
Me.Height = Screen.PrimaryScreen.WorkingArea.Height
The problem is this leaves gaps on the left, bottom, and right side. The top is the only screen edge that works as expected - snugged against the top. The others leave about a 1/8" gap to the screen edges, and 1/8" from the task bar at the bottom.
Sure, I could fudge it and hardcode +10 (or whatever) to the height and width, and -5 to the left. But that seems like a kludge (a fudge kludge), and maybe won't be the same for every monitor.
I tried the DPI awareness thing in the manifest, but it made no difference. I also tried Screen.PrimaryScreen.Bounds and Screen.PrimaryScreen.WorkingArea.X / Y, also with no joy.
It really shouldn't be this difficult. Wth?