-
I would like to customize the context menu of a textbox: I would like to keep the default items and add new ones. Unfortunately, if I understand correctly, the default context menu for textboxes is never assigned to the ContextMenu property, it is generated on the fly in response to ContextMenuOpening. So it seems there is no way to customize it, I need to build a context menu from scratch. Is that correct? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
That is correct. You could theoretically subscribe to TextBox.LostKeyboardFocus and the menu should be in e.NewFocus |
Beta Was this translation helpful? Give feedback.
-
Thanks. Sounds a bit brittle though and requires waiting for the event to be processed. I found an alternative based on the fact that context menus capture the mouse:
|
Beta Was this translation helpful? Give feedback.
That is correct. You could theoretically subscribe to TextBox.LostKeyboardFocus and the menu should be in e.NewFocus