I need to deploy an app that uses one monitor (in a 2 or 3 monitor setup) fullscreen.
This works so far, but:
No matter on what monitor i set the window fullscreen on, the neighbour monitor(s) also show parts of the fullscreen window, about 10-20 pixels. Tested on 4 systems. I am using 2023r2, Windows 11.
Is there a way to avoid this? I need to use the whole screen, without showing the taskbar and the like.
Window-Type: plain box, no menu, a canvas with top 0, left 0, width/height same as the window, all 4 sides locked. In the paint event of that canvas g.DrawPicture an image scaled to match the maximum size.
(I think this info was added after my response … if I overlooked it before, then my bad.)
This definitely sounds like you need to use your window’s .Bounds … using bounds will set the outside of the window border to the inside of the display. For example, these lines …
… will draw the inside of the window at DisplayAt(1)’s .Left edge, which will cause the window decorations/borders to draw into DisplayAt(0). Whereas, these lines …
Var myBounds As New Rect
myBounds.Left = DesktopDisplay.DisplayAt(1).Left
myBounds.Top = DesktopDisplay.DisplayAt(1).Top
myBounds.Height = DesktopDisplay.DisplayAt(1).Height
myBounds.Width = DesktopDisplay.DisplayAt(1).Width
Self.Bounds = myBounds
… will draw the window to completely fill DisplayAt(1), and all of the window decorations will be contained within DisplayAt(1).
Thank you for the suggestions!
You are right, I edited my post to be more precise.
I tried using you code above (mybounds). Works so far, but then I have some pixel from the desktop and some border pixel shown.
I am wondering why “window.fullscreen = true” does not work as I guessed.
I played a little further, and it works now. Have overseen I used .AvailableHeight instead of .Height.
Thanks to you I realized that one can set a window overlapping the taskbar without additional code.
Did not think about that before.