Enable/Disable buttons when certain MdiChild Window is Open

  • Thread starter Thread starter iDesmet
  • Start date Start date
I

iDesmet

Hallo,

First of all, I'm new at this group and I'm currently learning VB.NET
by my own (later I want to learn C#, but that's another story). In
other words, I'm a Newbie.

Anyway, I was wondering if someone is so kind to tell me how to enable
or disable some buttons when a MdiChild Window is opened.

For example, I have the Main Mdi Window opened, then I click in a
button (let's call it "btn01") and a Mdi Child window shows ("frm1"),
I can disable the button just calling "btn01.Enabled = False". But if
I open another Mdi Child window ("frm2") clicking in another button
("btn02"), I want that one button created in the frm2 ("btn01frm2")
gets disabled if the frm1 is opened, and disabled if is closed.

I had searched in this group, in the VS Documentation and in the
Internet but didn't find the answer I was looking for, maybe I made
the wrong question...

Well, I hope somebody can explain me how to achieve this.

Thanks in advance.

PS My apologies for my bad english.

Best Regards,
David Desmet
 
David,

The mdiContainer holds a collectionproperty that holds all its MDI childs,
by using that you can reach all the other MDI children.

http://msdn.microsoft.com/en-us/library/system.windows.forms.form.mdi...

Be aware that you sometimes have to write

myCurrentMDI.MDIparent.MdiChildren as you want to do this from a child
itself as I understand you want.

Cor

Cor,

Thank you very much for your quick reply! I'll to try that.

In case I can't achieve what I want to do with your suggested
solution, would you be so kind to show me an example in "code"?

Thanks again!

Best Regards,
David Desmet
 
Back
Top