This should be incredibly simple, and I don't know why I can't figure it out. I want my form to count the number of times a button has been clicked. As far as I can tell, Visual Basic has no increment operator, which is really stupid.
vb Code:
Private Sub Form_Load() Dim intCounter As Integer intCounter = 0 End Sub Private Sub Command1_Click() intCounter = intCounter + 1 End Sub
I've also tried different operators that work in other programming languages, such as intCounter++ and intCounter+=1, but none of them seem to work. Why doesn't this work? It's embarrassing that I can't figure this out.




Reply With Quote