关于事件的绑定和解绑

xiaoxiao2025-06-26  8

事件的解绑:this.button1.Click -= new System.EventHandler(this.button1_Click);  

如果一次事件如点击按钮事件要调用两个方法:在disinger中绑定。如点击和窗体加载两个方法:

this.button1.Click -= new System.EventHandler(this.button1_Click);  

 this.button1.Click += new System.EventHandler(this.Form1_Load);

转载请注明原文地址: https://www.6miu.com/read-5032542.html

最新回复(0)