[Help]Boolean[Solved]

Posts 13 of 3 · Page 1 of 1
[Help]Boolean[Solved]
hey i need a simple code that when i click a burron it will make a form op up but when i click it agin it will hide
Quote Originally Posted by tremaster View Post
hey i need a simple code that when i click a burron it will make a form op up but when i click it agin it will hide
Code:
 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        If Form2.Visible = False Then
            Form2.Show()
        Else
            Form2.Close()
        End If
    End Sub
What Flamesaber said, except you can also change it to this:

Code:
 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        If Form2.Visible = False Then
            Form2.Show()
            Button1.Text = "Hide"
        Else
            Form2.Close()
            Button1.Text = "Show"
        End If
    End Sub
So that you can tell what the button will do. It's not essential but it's a bit more user friendly.
Posts 13 of 3 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Need help?