|
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? |
Answered by
miloush
Sep 4, 2025
Replies: 2 comments 2 replies
|
That is correct. You could theoretically subscribe to TextBox.LostKeyboardFocus and the menu should be in e.NewFocus |
0 replies
Answer selected by
trebahl
|
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: |
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
That is correct. You could theoretically subscribe to TextBox.LostKeyboardFocus and the menu should be in e.NewFocus