Hi,
I have created a simple user control which includes a textbox and a button.I have added the user control and an UltraToolbarsManager to a form.I have added a PopupMenuTool and a ButtonTool to the ToolbarsManager with the ButtonTool added to the PopupMenuTool.Finally I've set the 'ContextMenuUltra on ToolbarsManager' property to the PopupMenuTool for the user control.
When I right click on the text box in the user control my context menu appears.
However if I right click on the text box again (without navigating elsewhere) the built-in textbox context menu appears (Undo, Cut, Copy, Paste etc.) not my context menu from the ToolbarsManager.
Any help getting my context menu to appear everytime and not the built-in textbox context menu would be greatly appreciated.
Many Thanks,Paul
Hello,
The behavior that you got is expected since the active component become the TextBox which holds the focus and handles messages from the OS. Same behavior is reproducible and with standard context menu strip. So what I could suggest is to handle MoseDown event of your text box and to pass the message to the user control. Please see attached sample.
Please let me know if you have any further questions.
Hi Hristo,
Thank you very much for your help and the sample. I made a mistake in my initial post that appears to be an important point; I am using the Infragistics UltraTextEditor not a TextBox.
Your sample works fine until I replace the TextBox with a UltraTextEditor and then the problem returns.
Any ideas would be greatly appreciated.
Thanks,Paul
I suggest you to use UltraFormattedTextEditor instead, UltraTextEditor uses TextBox internally and will be harder to apply this approach to it.
Thank you once again for your suggestion.
I've decided to go down the route of having an UltraToolbarsManager inside the user control (assigned to each child control) and firing events back to the main form.
Please do not hesitate to let me know if you have any further questions.