My once my application starts, is there a way to kill it no matter what it is doing via a button? I put a Cancel button on it that sets a CancelFlag and my app is processing while CancelFlag is false, but nothing happens when I press it.
You will need to put a DoEvents in the "Loop"(s) that is not giving up control. Be sure (by Enabled=False) that the user can't re-initiate the process that has the the DoEvents while you are in the DoEvents.
Private m_intDoEvents as integeer ' Module level variable
If m_intDoEvents count > 1000 ' or whatever
m_intDoEvents = 0
DoEvents ' Give Cancel a chance
End If
m_intDoEvents = m_intDoEvents + 1
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.