alter contextmenu of a textbox intratext adornment control

SyntaxEditor for WPF Forum

Posted 12 years ago by Nassim Farhat
Version: 11.2.0551
Avatar
HEllo,

I'm trying to alter the contextmenu of a textbox intratext adornment control.
Just like in your demo projects, i want to change the adornment from a button to a textbox and alter the contextmenu of that button. In your demo you did a similar thing where you would change the popup menu of the button programatically.
When I replace the button with a textbox and change its context menu, when right-clicking into the textbox, the menu of the syntaxeditor is always shown instead of the one i created. How do i override this? Please, try it yourself, you'll see that your editor menu always pops out on right-click instead of the one that you created.

Nassim

Comments (2)

Posted 12 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Nassim,

In our SyntaxEditor.OnContextMenuOpening method override, we show a menu if the event being bubbled up hasn't been handled. In your case, e.Handled is still false so SyntaxEditor thinks it needs to display a context menu.

You could either have your TextBox mark the e.Handled when that event is raised, or you could override SyntaxEditor.OnContextMenuOpening to look for your special scenario and not call the base method if you detect it.


Actipro Software Support

Posted 12 years ago by Nassim Farhat
Avatar
thanks,

will try that and let you know
The latest build of this product (v24.1.2) was released 12 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.