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
195
UltraFormattedTextEditor, disable the built in right click menu and replace it
posted

Hello,

 

Almost everything is in the title, I want to replace the built-in right click menu of a ultraFormattedTextEditor by my own, I can't find how, can you help me ?

 

Thanks

David

Parents
No Data
Reply
  • 12773
    Verified Answer
    posted

    Hello David,

    I believe you can use own context menu by replacing standard one.

    Here is the code snipped how to do add custom context menu with few items and handle ther click event:

        ContextMenu menu = new ContextMenu();
               
                MenuItem contextMenuItem;
                contextMenuItem = new MenuItem("Context Menu Item 1");
                contextMenuItem.Click += new System.EventHandler(this.contextMenuItem_Click);
                menu.MenuItems.Add(contextMenuItem);

                contextMenuItem = new MenuItem("Context Menu Item 2");
                contextMenuItem.Click += new System.EventHandler(this.contextMenuItem_Click);
                menu.MenuItems.Add(contextMenuItem);

                contextMenuItem = new MenuItem("Context Menu Item 3");
                contextMenuItem.BarBreak = true;
                contextMenuItem.Click += new System.EventHandler(this.contextMenuItem_Click);
                menu.MenuItems.Add(contextMenuItem);

                this.ultraFormattedTextEditor1.ContextMenu = menu;

        private void contextMenuItem_Click(object sender, EventArgs e)
            {
            // Implement the functionality for clicked menu items here
            }

    I hope this helps.

    Sincerely,
    Dimitrina Gineva
    Developer Support Engineer
    Infragistics, Inc.

Children