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

Can child forms listen for events on the parents mainmenu?

P: n/a
I know I can merge a child forms menu into the MDI parent's mainmenu, but I
would also like to listen for common events fired from the mainmenu that
might be of interest to any child forms.

Is this possible?
Nov 15 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Sean,

In order to do this, you will have to do some coding yourself.
Basically, you will have to register "listeners" with the parent form which
will be called when the menu items are clicked. When this happens, the
parent form will have to cycle through the listeners, seeing which one
handles the menu item that was clicked.

How you do this is up to you, as there are a number of ways that this
could be designed, but the overall concept is that the child forms would
register with the parent through some general mechanism indicating when a
menu item is clicked.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Sean Connery" <nf*@nospam.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
I know I can merge a child forms menu into the MDI parent's mainmenu, but I would also like to listen for common events fired from the mainmenu that
might be of interest to any child forms.

Is this possible?

Nov 15 '05 #2

P: n/a
I was afraid it wasn't going to be simple. Do you know of any code samples
where this is done?

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in
message news:ut**************@TK2MSFTNGP09.phx.gbl...
Sean,

In order to do this, you will have to do some coding yourself.
Basically, you will have to register "listeners" with the parent form which will be called when the menu items are clicked. When this happens, the
parent form will have to cycle through the listeners, seeing which one
handles the menu item that was clicked.

How you do this is up to you, as there are a number of ways that this
could be designed, but the overall concept is that the child forms would
register with the parent through some general mechanism indicating when a
menu item is clicked.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

Nov 15 '05 #3

P: n/a
Sean,

I don't know of any offhand. There might be something at
codeproject.com. You want to find something that implements a Command
pattern, as this is really what you are trying to do (a Command
infrastructure actually gives you a little more, but at its core, it's what
you want).
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Sean Connery" <nf*@nospam.com> wrote in message
news:On**************@TK2MSFTNGP12.phx.gbl...
I was afraid it wasn't going to be simple. Do you know of any code samples
where this is done?

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in message news:ut**************@TK2MSFTNGP09.phx.gbl...
Sean,

In order to do this, you will have to do some coding yourself.
Basically, you will have to register "listeners" with the parent form

which
will be called when the menu items are clicked. When this happens, the
parent form will have to cycle through the listeners, seeing which one
handles the menu item that was clicked.

How you do this is up to you, as there are a number of ways that this could be designed, but the overall concept is that the child forms would
register with the parent through some general mechanism indicating when a menu item is clicked.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com


Nov 15 '05 #4

P: n/a
Hi,

I have MDI Child and MDI Parent Window. Now I have FILE and EDIT menu
in Parent as well as Child window. When my Child window is launched,
the FILE menu of child should get merged to FILE menu of Parent and
EDIT menu of Child should get merged to EDIT menu of Parent. Can you
tell me how to do this? Also can you tell me how to trigger the click
events of CHILD MENU.

Thanks in advance.

Regards,
Sunil
Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com
Nov 15 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.