M
Mihir
Hi,
Copy and paste the below code.. Add Timer control and command button
to standard Exe project. Run the Code and Keep moving the mouse the
Form Freezes. Any Solution?
Option Explicit
Dim wasButtonPressed As Boolean
Private Sub Command1_Click()
wasButtonPressed = True
End Sub
Private Sub Form_Load()
Timer1.Interval = 5000
Timer1.Enabled = True
Command1.Caption = "OK"
End Sub
Private Sub Timer1_Timer()
Me.Enabled = False
wasButtonPressed = False
Command1.Caption = "Retry"
WaitForButtonPressed
End Sub
Sub WaitForButtonPressed()
Check_again:
Me.Enabled = True
If Not wasButtonPressed Then
DoEvents
GoTo Check_again
End If
Command1.Caption = "OK"
End Sub
‘ ************************
Copy and paste the below code.. Add Timer control and command button
to standard Exe project. Run the Code and Keep moving the mouse the
Form Freezes. Any Solution?
Option Explicit
Dim wasButtonPressed As Boolean
Private Sub Command1_Click()
wasButtonPressed = True
End Sub
Private Sub Form_Load()
Timer1.Interval = 5000
Timer1.Enabled = True
Command1.Caption = "OK"
End Sub
Private Sub Timer1_Timer()
Me.Enabled = False
wasButtonPressed = False
Command1.Caption = "Retry"
WaitForButtonPressed
End Sub
Sub WaitForButtonPressed()
Check_again:
Me.Enabled = True
If Not wasButtonPressed Then
DoEvents
GoTo Check_again
End If
Command1.Caption = "OK"
End Sub
‘ ************************