Timer_Tick Event

Ok. I want to create a Timer at runtime, and how do add its event handlers and all of that Someone please help.


Answer this question

Timer_Tick Event

  • wurriedbunny

    Ok. I am getting in the habit of finding out answers to my own questions, which I consider to be great! Smile. So I decided to go ahead and post the answer to this question, just in case someone else is wondering. I have created a label in a button_Click event, then also create the Timer_Tick event.

    private void button1_click(object, sender, EventArgs e)
    {
       Timer timer1 = new Timer();
       timer1.Tick += new EventHandler(timer1_Tick)

       (You can also add the properties of the timer tick event, such as the interval, and so forth).
    }

    private void timer1_Tick(object, sender, EventArgs e)
    {
       (You can now add the code you would like here)
    }

    Thanks again for all you guys and girls help. I will continuely try to return the favor and help out. :)

    Demitrius Wheelwright

  • Timer_Tick Event