WinForm 清除控件事件

//先清除事件
_MControl.MouseDown -= new MouseEventHandler(方法名);
_MControl.MouseUp -= new MouseEventHandler(this.Control_MouseUp);
_MControl.MouseMove -= new MouseEventHandler(this.Control_MouseMove);
_MControl.Click -= new EventHandler(this.Control_Click);

 

//绑定事件
_MControl.MouseDown += new MouseEventHandler(法名);
_MControl.MouseUp += new MouseEventHandler(this.Control_MouseUp);
// _MControl.MouseMove += new MouseEventHandler(this.Control_MouseMove);
_MControl.Click += new System.EventHandler(this.Control_Click);

你可能感兴趣的:(WinForm)