Hello everyone,
my question is, is there a code to minimize / maxmize a form when
clicking a button? I tried some codes and it didn't work. I got the blue
line...
Thanks for any help.
As Teemu stated, you must use form's WindowState property
by setting a value from FormWindowState enum as follows:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
' To minimize
Me.WindowState = FormWindowState.Minimized
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
' To maximize
Me.WindowState = FormWindowState.Maximized
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
' To normalize
Me.WindowState = FormWindowState.Normal
End Sub
HTH,
Onur Güzel