2

I made a small and simple program (I'm a newbie), and they a proceded to do the code. The thing is, I don't know why, one part of the code isn't directed to a button as it is supposed to. They have the same name.
How do I direct it.
The code says:

Private Sub Boton1_Click(ByVal sender As Object, ByVal e As EventArgs) If lblcalculadora.Text = "0" Then lblcalculadora.Text = "1" Else lblcalculadora.Text = lblcalculadora.Text + "1" End If 

And Design page the button is called "Boton1_clicl". But when I doubleclick that button, it creates a new private sub called Boton1_click_1.
How can I connect the first part of the code with that button. I know it's a realy stupid matter, but I'm really stuck in here.

2 Answers 2

2

You're missing Handles Boton1.Click

Private Sub Boton1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Boton1.Click If lblcalculadora.Text = "0" Then lblcalculadora.Text = "1" Else lblcalculadora.Text = lblcalculadora.Text + "1" End If 
Sign up to request clarification or add additional context in comments.

2 Comments

Thank you GJKH and @LarsTech
No problem, be sure to upvote any answers you found helpful and select one as the answer.
2

You are missing the handler:

Private Sub Boton1_Click(sender As Object, e As EventArgs) Handles Boton1.Click 

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.