I don't think you can do:
- If PictureBox3.click() then Close
First off PictureBox3.click is a method and it does not return a boolean.
Second - calling Picturebox3.click inside PictureBox3_click (which handles Picutebox3.click) is recursive and bound to just get you into trouble...
Instead try...
-
Private Sub PictureBox3_Click(sender As Object, e As EventArgs) Handles PictureBox3.Click
-
Static bClicked as Boolean = False
-
if bClicked = False then
-
bClicked = True
-
Me.WindowState = FormWindowState.Maximized
-
End if
-
End Sub
-
Of course you have no way to then minimize or normalize the form. Instead I would recommend you set it up as a toggle...
-
Private Sub PictureBox3_Click(sender As Object, e As EventArgs) Handles PictureBox3.Click
-
If Me.WindowState = FormWindowState.Maximized Then
-
Me.WindowState = FormWindowState.Normal
-
Else
-
Me.WindowState = FormWindowState.Maximized
-
End If
-
End Sub
-
This sets up a nice toggle between normal and maximized.