Home > Software engineering >  Novice seeks advice on VB how to write a pause continue to program
Novice seeks advice on VB how to write a pause continue to program

Time:10-23

In the great spirit show how under the new program is written to suspend & amp; Continue to program, in addition to use variable pauses to remember the state of this method (because some trival seems), to ask the great spirit show ah ~ ~ ~ thanks

CodePudding user response:

With a global variable
Private IsPause As Boolean

In your handler:
Sub Foo ()
While
You every step of the computation
DoEvents
While IsPause
DoEvents
Sleep Sleep under 100 'own add the definition of the API
Wend
Wend
End Foo

Button to continue:
IsPause=False
Button to suspend:
IsPause=True

CodePudding user response:

Sub Foo ()
While
You every step of the computation
DoEvents
While IsPause
DoEvents
Sleep Sleep under 100 'own add the definition of the API
Wend
Wend
End the Function

CodePudding user response:

Seems to be some understand ~ thank god I'm gonna study ~ ~

CodePudding user response:

Let her sleep is
Sleep (100)//pause 100 milliseconds
  • Related