Hi. I have been trying to make it so that a button is disabled when there are no open MDI windows. I know the code goes something like this, but I cannot figure out the right way to put it in.
if (Mdi.Children.Count = 0)
button2.Enabled = false;
Need a certain code
- LuxuriousMeat
- Posts: 824
- Joined: Thu Nov 03, 2005 6:43 pm
- Location: zzzzzzzzzzzzzzzz
- Contact:
Re: Need a certain code
Eaton wrote:Hi. I have been trying to make it so that a button is disabled when there are no open MDI windows. I know the code goes something like this, but I cannot figure out the right way to put it in.
if (Mdi.Children.Count = 0)
button2.Enabled = false;
Code: Select all
if (this.MdiChildren.Length < 1) button1.Enabled = false;
Code: Select all
this.Dispose();
MainFormType parent = (MainFormType)this.MdiParent;
if (parent.MdiChildren.Length < 1)
parent.MethodToDisableButton();
else
parent.MethodToEnableButton();