Hello group, I have a MAIN with title bar and Menu, if I position it in X=0 and Y=0, I no longer see the title bar and I no longer see the menu. How do you position the entire window at the top left?
I write:
That’s telling you what the difference between the bounds and the content area is. In other words, that’s the height of the Title Bar. As far as I can tell, 50 is a magic number you chose. Perhaps at random?
If you set the Window.Bounds.Top to DesktopDisplay.AvailableTop the Window will be correctly positioned under the Menu Bar. Is that not what you are trying to do?
Self.Top = (Screen(0).AvailableTop-self.Bounds.Top) i see a menu but not a title
Self.Top = Screen(0).AvailableTop +50 with my magic number, i see Tile and Menu.
I would like to set some parameters without having to think that I just got lucky by typing +50, but I can’t figure out how to display the entire window with the title and menu.
Don’t be offended… but there are some procedures that are difficult for me to understand. So, I followed your advice and tried to set the Bounds property…writing like this:
Var myBounds As New Rect
myBounds.Left = 0
myBounds.Top = 0
myBounds.Height = 1050
myBounds.Width = 405
Self.Bounds = myBounds
it need the Screen Available values as example if someone have the taskbar at top or left.
in case the user can use your window and should also see the os components.
you could also try opening the window maximized, at windows os it should use the available desktop space.
var oBounds as Rect = self.Bounds
oBounds.Top = DesktopDisplay.DisplayAt(0).AvailableTop
oBounds.Left = DesktopDisplay.DisplayAt(0).AvailableLeft
self.Bounds = oBounds
An important difference is that this design fetches the existing Bounds from the Window. The width and height don’t need to be hard coded. Meaning if the window size changes the code will not need to be updated.
and usually you need to read the data from correct monitor, most people have 2 monitors beside
and possibly not all people have same monitor sizes, or task bar only visible at the primary.
Remember to see the whole picture. OP’s original design was using Screen(0) so there’s no need for us to build an over-engineered demo for anything else.