Q: Checking Commandbuttons
soccerchum@prodigy.net wrote: I have a simple task i have to build for my intro to VB class. here is the situation: Create a form with a label and two command buttons captioned Bogart and Raines. When Bogart is first pressed, the sentence...
A: I like the problem so I tryed it. It's just friday overhere so not much to do.... Just make use of a variable and it will work fine.. make a new project, a new form; put a label on it and an indexed commandbutton (index 0 & 1). Put the next code in place; then press f5. 'general declarations Dim vRaines% Private Sub Form_Load() vRaines = False End Sub Private Sub Command1_Click(Index As Integer) Select Case Index Case 0 'bogart If vRaines Then Label1.Caption = "I was misinformed." vRaines = False Else Label1.Caption = "I came to Casablanca for the waters." End If Case 1 'raines Label1.Caption = "But we are in the middle of the desert!" vRaines = True End Select End Sub Return