This is a migrated thread and some comments may be shown as answers.

How to replace context menu on tabs?

3 Answers 118 Views
TabbedForm
This is a migrated thread and some comments may be shown as answers.
Serg
Top achievements
Rank 1
Veteran
Serg asked on 08 Jan 2021, 02:14 AM
The default tabs have a context menu. How can it be completely replaced or modified by removing unnecessary and adding new ones?

3 Answers, 1 is accepted

Sort by
0
Accepted
Dess | Tech Support Engineer, Principal
Telerik team
answered on 08 Jan 2021, 11:42 AM

Hello, Serg,   

RadTabbedFormControl offers the ContextMenuOpening event. It allows you to customize the default menu and add your own items. Please refer to the following help article which is quite useful on this topic: https://docs.telerik.com/devtools/winforms/controls/forms-and-dialogs/tabbedform/features/context-menu 

I hope this information helps. If you need any further assistance please don't hesitate to contact me. 

Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

0
Serg
Top achievements
Rank 1
Veteran
answered on 09 Jan 2021, 07:35 PM
Is it possible to replace the menu completely? For example use the system context menu (ContextMenuStrip) instead of DropDown?
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 13 Jan 2021, 10:26 AM

Hello, Serg,   

In the ContextMenuOpening event you have access to the Items collection. Hence, you can remove all the existing items and add any custom menu items that you need. You can find below a sample code snippet: 

        private void radTabbedFormControl1_ContextMenuOpening(object sender, RadTabbedFormControlItemConextMenuOpeningEventArgs e)
        {
            e.ContextMenu.Items.Clear();
            RadMenuItem item = new RadMenuItem("My Item");
            item.Click += Item_Click;
            e.ContextMenu.Items.Add(item);
        }

        private void Item_Click(object sender, EventArgs e)
        {
            //TODO
        }

Should you have further questions please let me know.

Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
TabbedForm
Asked by
Serg
Top achievements
Rank 1
Veteran
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Serg
Top achievements
Rank 1
Veteran
Share this question
or