Click here to Skip to main content
15,889,852 members
Articles / Programming Languages / Visual Basic
Tip/Trick

Use the same button to perform start and stop

Rate me:
Please Sign up or sign in to vote.
3.00/5 (1 vote)
21 Jun 2010CPOL 8.4K   2  
This trick is really meant for novice programmers...
Declare this in the general section inside the class:
dim flag as integer = 1

and then copy and paste the following code inside the button's click event:
If (flag = 1) Then
     'write down the statements to start...
Else
     'write down the statements to stop...
End If
flag *= -1

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
India India
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
-- There are no messages in this forum --