10-29-2009, 12:33 AM
|
#1 (permalink)
|
|
Game Journalist
Join Date: Feb 2008
Location: Mississauga, Ontario, Canada
Posts: 4,269
Reputation: 36
|
Visual Basic
This is a question for all of you programmers. So I have to make a program which can do various things for school. I have a plan in mind, but don't know how to execute it.
I will only explain the part where I am having trouble. I have a label which changes when you press a button. This is all good, but what I want is to change the label to different things when you click many times.
For example:
1 Click: Label will say Hi
2 Clicks: Label will say I'm fine
Ect.
What I am having trouble with is that the whole code executes in one click, making the end message come in one click.
Here is my idea, which doesn't work.
Code:
Private Sub btnHi_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnHi.Click
lblMessage.Text = "Hello!"
btnHi.Text = "How are you?"
If btnHi.Text = "How are you?" Then
lblMessage.Text = "I'm fine, you?"
End If
End Sub
So whats happening is that it quickly goes through it all, as after the button changes to say How are you? the program recognizes it and changes the label as well.
What I want is that the button says How are you? and then the user has to click on it to make the next message appear.
How can I do this?
|
|
|