Timeout with inputbox

Joined
May 21, 2011
Messages
5
Programming Experience
Beginner
Hi all i am creating an Alarm clock application that requires user input to deactivate the alarm. However is there away i can dispaly the inputbox for a limited time only say ( 1min) if no user input is entered after that time then the input box is closed. i have hunted google high and low but cant seem to find anything about it here's the code i am using.

Any help with this would be a GREAT help thanks all



If
My.Computer.Clock.LocalTime.TimeOfDay.ToString.Substring(0, 5) = alarmTime.TimeOfDay.ToString.Substring(0, 5) Then
speaker.Speak("Don't be alarmed, this is just an alarm . You have set an alarm named. " & alarmNameText & ". with the message. " & MessageText)
Timer1.Enabled =
False
If InputBox("say 'yes I want to stop this alarm' to stop this w alarm").ToLower.Contains("yes i want to stop this alarm") Then
speaker.Speak("ALARM ABORTED")
6:
End
7: Else
8: speaker.Speak("This will get really annoying in " & deadline & " minutes")
9:
End If
10:
11: Timer2.Enabled =
True
 
Create a regular dialog form for user input and use that instead of InputBox function. Use ShowDialog method to show the dialog, and for example use a Timer and close the dialog with Close method. Stop the Timer when dialog returns.
 
Back
Top