Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在制作一个 MDI windows 窗体应用程序,并且在父级中有一个面板。每次我打开一个孩子时,我都会将父母的面板设置为可见 = false 事件:MdiChildActivate。但是当我关闭所有孩子时,我想将父母的面板设置为可见 = true。
有没有办法做到这一点?
非常感谢,也许是一个菜鸟问题,但我什么也没找到。
为什么不直接订阅 Mdi 孩子的Closed事件,然后检查是否还有剩余的孩子?
Closed
void CreateMdiForm() { var child = new SomeMdiChildForm(); // do stuff child.FormClosed += child_Closed; } void child_Closed( object sender, FormClosedEventArgs e ) { if( MdiChildren.Length == 0 ) { SetPanelVisible(); } }