'Nothing happens when I double click on the timer tool on the form [closed]

I want to add event code to my timer component.

Nothing happens when I double click on the timer tool on the form.

enter image description here



Solution 1:[1]

Double click on the (1) below and the designer will create an empty event code

fig1

For example

  1. Double click

    fig2

  2. Designer creates code

    fig3

  3. Empty Event

    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
    
        private void timer1_Tick(object sender, EventArgs e)
        {
    
        }
    }
    

Solution 2:[2]

If you open the form's properties you should be able to select the element you want to work with in the drop-down list. Select the timer and go to the events tab and create an onTick event.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 John Alexiou
Solution 2 Stockstad