Link to home
Create AccountLog in
Avatar of vbnetcoder
vbnetcoder

asked on

Cancel - a executing for next loop if a button is clicked

In my windows form based application I have a for each loop.  I want the application to do it stuff in the for next loop until it is done OR the user clicks on the cancel button.  How would i make it recognise that the cancel button has been clicked while the for loop buttons is executing in another procedure??
ASKER CERTIFIED SOLUTION
Avatar of Mike Tomlinson
Mike Tomlinson
Flag of United States of America image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of vbnetcoder
vbnetcoder

ASKER

It tells me that DoEvents is not declared
Sorry...for VB.Net you'd use "Application.DoEvents()".
That works thanks much!
ty