For all you seasoned VB programmers this is going to be a no brainer.
However, as a C programmer learning VB I'm having trouble getting my
arms around the event-driven nature of VB.
Suppose I have a form with a single command button (cmdPush).
The form's code (including the cmdPush_Click() sub is between the
dashed lines.
--------------------------------------------------------------------
Option Explicit
Dim i As Integer
Private Sub Form_Load()
i = 0
End Sub
Private Sub cmdPush_Click()
i = i + 1
End Sub
--------------------------------------------------------------------
After cmdPush is pushed 10 times I want the program to end. HOWEVER,
I do not want the cmdPush_Click() to test the value of i or to end the
program. I want that done somewhere else. The way I would do this in
C doesn't work in VB because of the event-driven natue of VB!
How do I do this in VB?
Multiple different answers will be greatly appreciated!
..ARN.
However, as a C programmer learning VB I'm having trouble getting my
arms around the event-driven nature of VB.
Suppose I have a form with a single command button (cmdPush).
The form's code (including the cmdPush_Click() sub is between the
dashed lines.
--------------------------------------------------------------------
Option Explicit
Dim i As Integer
Private Sub Form_Load()
i = 0
End Sub
Private Sub cmdPush_Click()
i = i + 1
End Sub
--------------------------------------------------------------------
After cmdPush is pushed 10 times I want the program to end. HOWEVER,
I do not want the cmdPush_Click() to test the value of i or to end the
program. I want that done somewhere else. The way I would do this in
C doesn't work in VB because of the event-driven natue of VB!
How do I do this in VB?
Multiple different answers will be greatly appreciated!
..ARN.
Comment