To exert a little more control over the windows in your programs, you can set the WindowState property to maximize or minimize them. Here's how you set that property, and what those settings mean:
FormWindowState.Maximized- Window is maximized.
FormWindowState.Minimized- Window is minimized.
FormWindowState.Normal- Window is set to normal state.
Here's an example in which we minimize a form when the user clicks a button:
Private Sub Button1_Click(ByVal sender As System.Object, _ ByVal e As System.EventArgs) Handles Button1.Click Me.WindowState = FormWindowState.Normal End Sub
You can also set the Enabled property to enable or disable a window. (When it's disabled, it will only beep if the user tries to give it the focus.) You set the Enabled property to True to enable a window and to False to disable it.