我正在尝试编写一个代码,在单击 Visual Basic 中的按钮后将值增加一。这些是我迄今为止尝试过的代码,但我没有实现我的目标
代码 1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim votecount As Integer = Integer.Parse(showcountwinnie.Text)
votecount += 1
showcountwinnie.Text = votecount.ToString()
End Sub
代码二
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim votes As Integer
votes = 0
votes += 1
votes = showcountwinnie.Text
End Sub
代码三
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim votewinnie As Integer
votewinnie = showcountwinnie.value
votewinnie = votewinnie + 1
showcountwinnie.value = votewinnie
End Sub