See it.
You need to start to find out the necessary height. It, of course, depends on which monitor your window is on. For the main monitor, the height can be obtained simply as SystemParameters.PrimaryScreenHeight
( SystemParameters
still has many useful properties, look, it may be useful). In this case, you will have to ensure the launch of the application on the main monitor.
Or you can bypass all monitors (or if your window is already on the screen, find out which monitor it is on), as advised here (through the functionality of WinForms Screen.FromHandle
or Screen.AllScreens
) and find out the height of the desired monitor.
Great, we have a height. Now there are two strategies: “attach” the window (as in maximize mode) or allow resizing (as in Vista / Windows 7). For the second option, you simply set the Y-position to 0 and the height to the desired value (it may also be necessary to correct X also so that the window completely moves to the selected monitor). If you want to attach, try setting the Binding
in the manner described here . (This code monitors window size changes and updates the height automatically.)