Sunday, November 14, 2010

How do you use ';if statements'; with a command button in VB 2008?

I'm trying to create a program to disable a button after it has been clicked. It's cracking a code. You pick 3 numbers you guess, once one number has been clicked, it is disabled. After you click the 3rd command button, all the buttons you clicked before that are switched back to enabled then you check for your answers.



I was wondering, how do I enable and disable them upon clicking through an if statement?How do you use ';if statements'; with a command button in VB 2008?
Use Enable property when you click on them.

Button1.Enabled = True

Button1.Enabled = False



Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

If Button1.Enabled %26lt;%26gt; True Then

Button1.Visible = False

End If

End Sub



check this out

http://www.startvbdotnet.com/language/op鈥?/a>How do you use ';if statements'; with a command button in VB 2008?
I will try

Report Abuse

No comments:

Post a Comment