menu clicks (c#)

J

JT

Hi,

I would like to know if it's possible to detect clicks on parent menus. I'm
wanting to map a tree structure to a menu structure. The "data" is not just
located in the leaf nodes of the tree; the parent nodes also have data. When
a node is selected from the tree, I want an action to occur (say, a dialog
come up). Let's say I have the following menu structure (which is a direct
mapping of my original tree data):

root
|_ Node 1
| |_ Node 1-1
| |_ Node 1-2
|_ Node 2
|_ Node 2-1
|_ Node 2-2

I want to be able to click on Nodes 1 or 2 and have a dialog come up. By
default, clicking on those menu items makes the children menu appear (Node
1-1 and Node 1-2, or Node 2-1 and Node 2-2). That can already happen by
hovering over those menu items, so I find it redundant that clicking on them
does the same thing. Therefore, if the user clicks on Node 1 and Node 2, I
would want the application to detect the click and make something happen.

Is the above possible? Simply adding a handler for the click event does
nothing; it never gets called (for menu items that have children items).
Then I tried subclassing the MenuItem class, and overriding the OnClick()
method; but that didn't work either, OnClick() never gets called... Help!

Thanks
JT
 
J

JT

No, we ended up doing something else. I'm surprised no one even suggested
anything :(
If you do figure it out, please do post the answer...

JT
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top