我正在.NET Framework 上使用 C# 进行开发。我已经在 Button 上有一个事件,只需单击一下即可。我还想在双击时为同一个按钮举办一个活动。
如何在 Button 上创建双击事件?我试过这个,但它不起作用:
this.SetStyle(ControlStyles.StandardDoubleClick, true);
this.button1.DoubleClick += new System.EventHandler(button1_DoubleClick);
private void button1_DoubleClick(object sender, EventArgs e)
{
MessageBox.Show("You are in the Button.DoubleClick event.");
}