new System.Windows.Forms.MouseEventHandler(this.eventFunction)
上面發送'object sender'和'MouseEventArgs e'給我的事件函數。我需要發送另一個對象,但如果我使用:創建自定義事件處理程序需要幫助
System.Windows.Forms.MouseEventHandler(this.eventFunction(object, MouseEventArgs, objectINeed));
它不起作用。它只是說有一個無效的論點。即使我公然向它發送一個對象MouseEventArgs對象。
任何人都可以提供任何見解嗎?
你想傳遞什麼對象? –
http://www.switchonthecode.com/tutorials/csharp-snippet-tutorial-custom-event-handlers –
但是,我認爲你應該能夠從'MouseEventArgs'或'EventArgs'繼承並創建你自己的。 – IAbstract