but notice if u press the back key it would also resume.
other solution
if u need wait until a flag is set u can use this.
the "sleep" will continue the event loop.
Code:
Closed = False
Wait For(WaitClose) Complete (Result As Boolean)
Sub WaitClose As ResumableSub
Do Until Closed =True
Sleep(0)
Loop
Return True
End Sub
Sub ButtonOk_Click
Closed=True
End Sub