Displaying a menu

How could I go about displaying a menu with submenus? I want it to go under a textfield. I could use a combobox but the problem is, I do not think you can use submenus with them.

Here is a screenshot of the sort of thing that I am trying to achieve:
https://www.dropbox.com/s/0ucjxefpln2ncx4/Untitled.png

Thanks

Create a Contextual Menu from the appropriate event in your Textfield

Oops the forum has made a duplicate post. Here is my newer thread with a little more info on what I am trying to achieve. Thanks

The problem with this is that it positions it exactly where the mouse is and it does not respond to the left mouse button.

Thanks

You do not have to use the contextual menu as-is. Or put another way, you can co-opt the contextual menu handlers, or bypass them altogether.

MenuItem has a PopUp method that you can call to display the menu wherever you want. So construct a menu (you can create a subclass of EditField and call ConstructContextualMenu from Mousedown, for example) and pop it up in MouseDown.

(This also answers your other question about how to have a menu display in response to a left click.)

[quote=54259:@Tim Hare]You do not have to use the contextual menu as-is. Or put another way, you can co-opt the contextual menu handlers, or bypass them altogether.

MenuItem has a PopUp method that you can call to display the menu wherever you want. So construct a menu (you can create a subclass of EditField and call ConstructContextualMenu from Mousedown, for example) and pop it up in MouseDown.

(This also answers your other question about how to have a menu display in response to a left click.)[/quote]
Thanks!!