Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: Visual Basic
Expertise: Beginner
Oct 1, 1996

Checking for Cancel in Loop

Question:
I have started using VB3 yesterday to do a small project. I use Access normally. I wish to set use one button to initiate a loop and another button to stop the loop. I have seen your response to a similar question where you said to set a flag to false in the second button and to check for it in the loop. However I cant seem to get the program to allow me to click the second button when it is running. Can you show me some snippets of code?

Answer:
Within the loop right before you check the flag, put in the DoEvents statement. That will tell the system to check to see if any Windows events have happened and to process them. Otherwise, the program will seem to ignore the button press.

DevX Pro
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date