Use the same button to perform start and stop - xfgr.com Click here to Skip to main content

Use the same button to perform start and stop

This trick is really meant for novice programmers...
Sign Up to vote for this article
Add a reason or comment to your vote: x
0
answers
3.0/5
1 vote
354
views
Tags: VB7.x, VB, VB.NET

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
Posted 17 Jun '10 5:58 PM
Edited 21 Jun '10 3:30 AM
Revision 2

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

Hint: For improved responsiveness use Internet Explorer 4, Firefox or above. Ensure Javascript is enabled and choose 'Normal' from the Layout dropdown and hit 'Update'.
You must Sign In to use this message board.
FAQ FAQ   
Noise Tolerance  Layout  Per page   
  (Refresh) 
-- There are no messages in this forum --

General General    News News    Question Question    Answer Answer    Joke Joke    Rant Rant    Admin Admin   


 
Last Updated 26 Mar 2009
Web18 2.3.0027 Advertise Privacy