hi
number1 for the first click
number 2 for the second click
number3 for the third click
number 4 for the forth click
and so on..
thanks
Printable View
hi
number1 for the first click
number 2 for the second click
number3 for the third click
number 4 for the forth click
and so on..
thanks
VB Code:
dim counter as long public sub command1_click() counter = counter + 1 msgbox counter end sub
:)
If you want to use this counter only inside your click sub this is better:VB Code:
Public Sub Command1_Click() Static Counter As Long Counter = Counter + 1 MsgBox Counter End Sub
Here is a simple (short) way to increment a CommandButtons caption:
VB Code:
Private Sub Command1_Click() Command1.Caption = CStr(CInt(Command1.Caption) + 1) End Sub
Note: Set the Caption to '0' (at load or at design time)
Bruce.