我正在尝试从同一个窗口窗体文件的另一个方法中调用单击事件。它对我不起作用。
例如:
theClass = partial class(System.Windows.Forms.Form)
method AlarmListBox_Click(sender: System.Object; e: System.EventArgs);
private
protected
public
method DoSomething;
end;
method theClass.DoSomething;
begin
self.AlarmListBox_Click; <<<this is where i want to call the click event
end;
无论我做什么,它都会不断引发编译器错误。我尝试了 AlarmListBox.Click、AlarmListBox.performClick 等。
我得到的一些错误:
- 没有参数为 0 的重载方法“AlarmListBox_Click”。
- 无法访问基础事件字段
那么,如何在同一个窗体窗体中触发事件呢?