I'm trying to add a double click event to a button in winforms but it never executes in run-time. My buttons are created dynamically at run-time
This is what I am trying at the moment:
buttons[r][c].MouseDoubleClick += new MouseEventHandler(mouseDBL_Click);
private void mouseDBL_Click(object sender, EventArgs e)
{
// do something
}
I also tried:
buttons[r][c].DoubleClick += new EventHandler(gridDBL_Click);
private void gridDBL_Click(object sender, EventArgs e)
{
// do something
}
I really don't understand why this does not work.