如果我设置一个拥有的窗口:
OwnedWindow ownedWindow = new OwnedWindow();
ownedWindow.Owner = this;
ownedWindow.Show();
有可能获得关于所拥有的窗口关闭的通知吗?
答案 0 :(得分:4)
是
OwnedWindow ownedWindow = new OwnedWindow();
ownedWindow.Owner = this;
ownedWindow.Closing += new System.ComponentModel.CancelEventHandler(ownedWindow_Closing);
ownedWindow.Show();
此处理程序应位于所有者窗口中。
void ownedWindow_Closing(object sender, System.ComponentModel.CancelEventArgs e)
{
}