when Main1 loads it should wait for 10 seconds and direct to another form(bpaper) if the system time is less than 4.00 p.m
if the system time is greater than 4.00 p.m then it should remain in the Main1
how can i do this using a timer?
(Main forms' isMdiContainer is true!)
form load of Main
Expand|Select|Wrap|Line Numbers
- Main1 one = new Main1();
- one.MdiParent = Main.ActiveForm;
- one.Show();
form load of Main1
Expand|Select|Wrap|Line Numbers
- timer1.Start();
- timer1.wait(1000); //how can i wait the timer here?
- t1 = DateTime.Now;
- t2 = Convert.ToDateTime("16:00:00 ");
- bpaper test = new bpaper();
- //do not allow the bpaper to be appear after 4oclock
- if (t1<t2)
- {
- timer1.Stop();
- this.Hide();
- test.Show();
- }
- else
- {
- timer1.Stop();
- this.Show();
- MessageBox.Show("Time out ",t1.ToString());
- }