RadTabbedFormControl New Tab Button reappears when tab is popped out.

1 Answer 114 Views
TabbedForm
Dave
Top achievements
Rank 1
Dave asked on 15 Feb 2022, 10:26 PM

For my tabbed form I have set ShowNewTabButton to false to disallow creating new tabs. But, when a tab is popped out to its own window, the new tab button appears. I would like to hide or disable this button.

Thank you.

Screenshot:

The top (main) form has three tabs and no new tab button (plus sign) since ShowNewTabButton has been set to false. But the "Home - Start" tab, which has been dragged out/popped out into its own window, has the new tab button. I would like know how to hide or disable it.


1 Answer, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 18 Feb 2022, 08:56 AM
Hello, Dave,

Please have in mind that the ShowNewTabButton property is relevant for a specific RadTabbedFormControl. When you pop out a window, a new RadTabbedFormControl is created. Hence, its ShowNewTabButton property is set true by default. 

The possible solution that I can suggest is to handle the creation of the new tab control and disable the new button: 
        public RadTabbedForm1()
        {
            InitializeComponent();

            this.AllowAero = false;

            this.radTabbedFormControl1.ShowNewTabButton = false; 

            this.radTabbedFormControl1.TabbedFormControlElement.ItemDragService.TabbedFormShown += ItemDragService_TabbedFormShown;
        }

        private void ItemDragService_TabbedFormShown(object sender, TabbedFormShownEventArgs e)
        {
            e.TabbedForm.TabbedFormControlCreating -= TabbedForm_TabbedFormControlCreating;
            e.TabbedForm.TabbedFormControlCreating += TabbedForm_TabbedFormControlCreating;
        }

        private void TabbedForm_TabbedFormControlCreating(object sender, TabbedFormControlCreatingEventArgs e)
        {
            e.TabbedFormControl.ShowNewTabButton = false;
        }

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

Regards,
Dess | Tech Support Engineer, Principal
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/.

Dave
Top achievements
Rank 1
commented on 19 Feb 2022, 01:52 AM

Your solution works. Thank you!!
Tags
TabbedForm
Asked by
Dave
Top achievements
Rank 1
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or