看板 C_Sharp 關於我們 聯絡資訊
假設我操做一個button1.Click會產生以下程式 this.button1.Click += new System.EventHandler(this.button1_Click); 那之後 private void button1_Click(object sender, EventArgs e) { //我需要呼叫dispose或插入以下程式碼嗎? this.button1.Click -= new System.EventHandler(this.button1_Click); } -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 36.237.253.95 ※ 文章網址: https://www.ptt.cc/bbs/C_Sharp/M.1454127517.A.4CB.html
ssccg: 除非你只要按一次不然為什麼要移除? 01/30 13:55
ssccg: 另外要移掉的是原本那個的話,你用 -= new 也不對 01/30 13:55