-
Alarm and Combo box!
Hi guys!
I have a combo box with these data...
1*45minutes
2*45minutes
3*45minutes
4*45minutes
5*45minutes
6*45minutes
I have also a command button and a WindowsMediaPlayer. I would like when the user choose an option from combo box and then press the command button (OK) WindowsMediaPlayer will play a song after the minutes expire that user chose. For example something like that...
If If Combo1.Text = "2*45minutes" Then
WindowsMediaPlayer play a song after 90 minutes
End if
If If Combo1.Text = "3*45minutes" Then
WindowsMediaPlayer play a song after 135 minutes
End if
And so on...
I do know that i have to use a timer to do that but i dont know how!
HELP ME GUYS!:sick:
Thanks!
-
Re: Alarm and Combo box!
On command click do this
1. Save current date/time value using the Now function in a global variable
2. Calculate the value in mintes based on combo selection and store in a global variable
3. Enable the timer
On the Timer's Timer event do this
use DateDiff to calculate the difference in seconds between the saved time from above step 1 and current time. If it is equal or greater than the value in variable from step 2 (times 60 to be in seconds) start playing (and disable the timer)
(in design mode, set the interval of the timer to 500, and set it to enabled = false)