Sub AppStart (Form1 As Form, Args() As String)
MainForm = Form1
MainForm.RootPane.LoadLayout("layMain") 'Load the layout file.
tmr.Initialize("tmr", 1000)
MainForm.Show
Wait For TaskCompleted(Result As String)
lblAnswer.Text = Result
End Sub
Sub Chosen_Click
tmr.Enabled = False
Dim btnSender As Button = Sender
Dim Answer As String = btnSender.Tag
SetViews
RaiseEvent(Answer)
End Sub
Private Sub RaiseEvent(Answer As String)
CallSubDelayed2(Me, "TaskCompleted", Answer)
End Sub
Private Sub tmr_Tick
mCounter = mCounter + 1
lblCount.Text = mCounter
If mCounter = 5 Then
tmr.Enabled = False
SetViews
RaiseEvent("Time out")
End If
End Sub