how to increment after button click -vote process [Resolved]

Posted by Oswaldlily under ASP.NET on 11/9/2011 | Points: 10 | Views : 1644 | Status : [Member] | Replies : 1
I have 2 buttons in windows application.
If i clicked once it shd be counted as 1

in my second click automatically increase.
In my third click again need to increase...similarly for all click upto n values
how to do?


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

End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Label2.Text = 1
End Sub

In my second click i need to increment it..




Responses

Posted by: Oswaldlily on: 11/9/2011 [Member] Starter | Points: 25

Up
0
Down

Resolved
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) Handles Button2.Click
If label1.Text = "iss" Then
label1.Text = String.Empty

End If
If label1.Text = String.Empty Then
label1.Text = 1
Else
label1.Text = Convert.ToString(Convert.ToInt32(txt1.Text) + 1)
End If
End Sub

Oswaldlily, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response