62,046
社区成员
发帖
与我相关
我的任务
分享
public void CloseWindow()
{
((Form)this.Parent).Close();
}
出现报错,但是当在弹出的OCX控件中添加一个button按钮,调用该方法时能够正常关闭。
public void CloseWindow()
{
var form = this.FindForm();
form.Close();
}
this.ParentForm
this.FindForm()
这两个自己选一个用。。。