문제

I have MDI form Application, This application contains a menuStrip.
The menuStrip contains Save & save as.

What I want is, if there is an open file(MDI child) the save & save as will be enable, otherwise disable.
Note: I haven't any code to do that because I don't know where can I write the code.

Now, How I can write the code? and where ?

도움이 되었습니까?

해결책

on create child window,

 var newChild = new Form() { MdiParent = this };
 menuItem.Enabled = true;
 newChild.FormClosing += (s, o) => menuItem.Enabled = (this.MdiChildren.Length  == 1) ? false : true;
 newChild.Show();
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top