Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
665
Using an UltraToolbarsManager with a UserControl
posted

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

Parents
No Data
Reply
  • 48586
    Suggested Answer
    posted

    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.

    163565.7z
Children