473,406 Members | 2,954 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Enable/Disable buttons when certain MdiChild Window is Open

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
2 2022
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Manjit | last post by:
Hi EveryOne, I know it is very common question and had been asked few times, but still after researching all the threads I couldn't solve my problem. So here it is out in open and I hope that I...
1
by: hortoristic | last post by:
We are using JavaScript to Enable/Disable certain fields on web pages based on business rules. A simple example is if when using an option type tag, and the two options are Yes and No. If YES...
29
by: lori3laz | last post by:
How do you disable the right click>view source option on web pages so people can't view your coding and copy it? What's the html I need to include in my website to utilize this feature? Thank...
1
by: Terry Olsen | last post by:
Is there any way to disable the client browser "Back" and "Forward" buttons while on my site? Or how would I go about knowing that a page hit is caused by a back/forward navigation? I have...
16
by: MLH | last post by:
If I give someone a runtime app, they can open the database window by pressing the F-11 key. How to prevent???
2
by: Kevin | last post by:
I've been looking all over and I can't seem to find what ought to be simple. I need to disable a drop down when a checkbox is checked, and enable it when same checkbox is unchecked. I've...
6
by: Brandon McCombs | last post by:
Hello, I have a form that contains a listview on the left side and a column of buttons on the right side. Only some of the buttons do I want enabled all the time. The other buttons should be...
3
by: Pietro | last post by:
Hi all, First of all I'd like to thank you very very much ,as finally after many years of searching,I could find a code to disable/enable the shift key,but actually i cannot use the code as I'm...
3
by: =?Utf-8?B?UGxhdGVyaW90?= | last post by:
I have link buttons in a Gridview that, depending on the value in another column (Not the Key column) will need to be disabled. For example, (Column2 has link buttons) Column1 ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.