public void Timer_Tick(object sender, EventArgs e) { if (progressBar1.Value < 5) { progressBar1.Value++; } else { timer.Stop(); MyEventHandler myEventHandler = new MyEventHandler(this); myEventHandler.CreateEvent(); } }
private void button2_Click(object sender, EventArgs e) { MyEventHandler myEventHandler = new MyEventHandler(this); myEventHandler.CreateEvent(); /*if (!eventPressedOnce) * { * eventPressedOnce = true; * } * else * { * * eventPressedOnce = false; * } */ }