As the title says, I cant seem to figure out how to minimize a window after maximized. I am using a Plain Box window with all Min, Max and Close buttons disabled. I have a temporary Pushbutton as a maximize and minimize control (Changing it to a custom Canvas button at a later date).
within the Buttons Action event I have
Window1.Maximize()
Window1.Minimize()
I know Window1.maximize() works on its own. but how do i add Minimize to the event? ive tried the above and If statement…
If Window1.Maximize() then
Window1.Minimize()
Else
Window1.Maximize()
End if
I know I’m doing this wrong but could someone point me in the right direction?
Ah, ok, a three-steps process (if normal, maximise, if maximised, minimise).
Now, I seem to remember you can’t minimise directly a maximised window under Windows (you’d have to restore it first). I’m really not sure, as the last time I did “intensive” programming under Windows was around 15 years ago.
Perhaps try to restore it (un-maximise it) before minimising it?
First off, by ‘minimize’ are you trying to minimize the window to the taskbar or are you trying to restore it from fullscreen to it’s previous size? Either way, you should probably set a variable to remember the actual state of the window. Something like the following will maximize and restore the window.
Static fs As Boolean = False
If fs Then
Window1.Restore
fs = False
Else
Window1.Maximize
fs = True
End If