By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
426,060 Members | 1,878 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 426,060 IT Pros & Developers. It's quick & easy.

Enable/Disable buttons when certain MdiChild Window is Open

P: n/a
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
Jun 27 '08 #1
Share this Question
Share on Google+
2 Replies


P: n/a
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/libr...ichildren.aspx

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
"iDesmet" <id**********@gmail.comschreef in bericht
news:e5**********************************@t12g2000 prg.googlegroups.com...
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
Jun 27 '08 #2

P: n/a
On Jun 5, 11:15 pm, "Cor Ligthert[MVP]" <notmyfirstn...@planet.nl>
wrote:
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/libr...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

"iDesmet" <idesmet.w...@gmail.comschreef in berichtnews:e5**********************************@t 12g2000prg.googlegroups.com...
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
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
Jun 27 '08 #3

This discussion thread is closed

Replies have been disabled for this discussion.