Click here to Skip to main content
15,893,508 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
ı m useing 1 combobox and timer.In this combobox , ı have 5minutes,10minutes and 15 minutes.when ı will select in combo index it will reminder me ,After which minutes selected?
Posted
Comments
Jawad Ahmed Tanoli 16-Feb-15 11:01am    
so where is problem ? if it remind you after some time
ibrahim-34 16-Feb-15 11:14am    
it is not remind me.ı need write code for whic ı want it will remind
Kuthuparakkal 16-Feb-15 11:20am    
Unclear

This sounds like homework, so I won't give you code.
But it's not complex:

Handle the ComboBox.SelectedIndexChanged event[^] and get the new value.
Convert the new value to a number of seconds, and add it to the current DateTime.
Save this in a class level variable alarmTime.
Set your timer to fire once per second.
In the Timer.Tick event, compare the alarmTime and the current time. If it is now after the alarmTime, set alarmTime to DateTime.MaxValue and issue your reminder.
 
Share this answer
 
Comments
ibrahim-34 16-Feb-15 11:47am    
Thank you
OriginalGriff 16-Feb-15 11:52am    
You're welcome!
        private void Display()
        {
            MessageBox.Show("Time start now");
           //5000 is the number of miliseconds you want to pause.
            System.Threading.Thread.Sleep(5000);

            MessageBox.Show("Time Stop now");
        
        }

//On selected index Change
 Thread t = new Thread(Display);
            t.Start();
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900