I have a user control ultimately derived from a TextBox.
I want to suppress the right-click context menu for this control.
I've added a code to intercept the ContextMenuOpening event on the user control and to suppress the context menu:
ContextMenuOpening += HandleIt;
...
private void HandleIt(object sender, ContextMenuEventArgs e)
{
e.Handled = true;
}
When the control is empty (no .Text) this works fine.
However, when the control has some text, HandleIt() is not even called.
Am I doing something wrong?
How do I suppress the context menu for this user control under all conditions?