Hello,
I have 2 forms with 2 pictureBoxs, showing photos.
In the forms there is timer set to 10Sec.
In those 10Sec, the viewer can Key press for an answer.
Right after key press, I would like to switch between the forms (no regarding to the remaining time), and restart the timer..
How can I do that?
I've created timer1, timer2 in Form1, Here is the code in Form1:
And timer1 in form 2, Here is the code in Form2:Code:private void timer1_Tick(object sender, EventArgs e) { if (!stopSlideshow) { timer1.Stop(); timer2.Start(); form2.Show(); form2.startTimer(); this.Hide(); } } private void timer2_Tick_1(object sender, EventArgs e) { if (!stopSlideshow) { pictureBox1.Image = getPicture(); timer2.Stop(); timer1.Start(); } }
Tick Event is timer1_Tick_1.Code:public void startTimer() { timer1.Start(); } private void timer1_Tick_1(object sender, EventArgs e) { timer1.Stop(); this.Hide(); Form1.F1.Show(); }
I already used the "Keydown" event to save the viewer's answer.
Thanks!


Reply With Quote
Bookmarks