
I would like to add a context menu to the editor in my application, but I need most of the items in the context menu to be context sensitive (no pun intended).
For instance, if a user right clicks on a selection, I'd like cut/copy/paste/etc. to show up on the menu, if they right click with no selection I'd like paste to show up, along with other items...
If the item they right click is an identifier (formula name), I'd like to show them some choices for what to do with that identifier - for instance, "open formula in another window", "browse to formula", ... If the item is something weird like whitespace or an operator, I'd like to show only the clipboard ops.
How do you recommend is the best architecture for this - should I use one shared context menu and an event handler to filter the menu based on the right click location? Is there even an event for me to use for this?
Can I do what I'm looking for using the ContextMenuStrip property (and DefaultContextMenuEnabled = false)? What event should I hook to do the filtering?
Thanks,
For instance, if a user right clicks on a selection, I'd like cut/copy/paste/etc. to show up on the menu, if they right click with no selection I'd like paste to show up, along with other items...
If the item they right click is an identifier (formula name), I'd like to show them some choices for what to do with that identifier - for instance, "open formula in another window", "browse to formula", ... If the item is something weird like whitespace or an operator, I'd like to show only the clipboard ops.
How do you recommend is the best architecture for this - should I use one shared context menu and an event handler to filter the menu based on the right click location? Is there even an event for me to use for this?
Can I do what I'm looking for using the ContextMenuStrip property (and DefaultContextMenuEnabled = false)? What event should I hook to do the filtering?
Thanks,
Kelly Leahy Software Architect Milliman, USA