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

Change RadDock TabStrip at Runtime

1 Answer 159 Views
Dock
This is a migrated thread and some comments may be shown as answers.
Sacha
Top achievements
Rank 1
Sacha asked on 24 Apr 2019, 01:14 PM

Hi, I have a mainform containing a radDock. Whenever I launch a new form they appear in the tabstrip. Is there any way to modify the tabstrips of some forms at runtime to show a number ?

 I would like it to look like notifications in chrome tabs.

 

Thank you for the help !

 

 

1 Answer, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 25 Apr 2019, 08:08 AM
Hello, Sacha,    

According to the provided information, it is not clear enough how exactly you show he form in RadDock. However, I would liek to note that RadDock has the capability of automatically finding and attaching Multiple Document Interface (MDI) child forms as tabbed documents. Additional information is available in the following help article: https://docs.telerik.com/devtools/winforms/controls/dock/mdi-mode/automatic-mdi-form-handling

In order to customize the text and icon shown in the hosted form as a tabbed document, you need to handle the DockWindowAdded event. Please refer to the following help article which result is illustrated in the attached screenshot:

public RadForm1()
{
    InitializeComponent();
 
    this.IsMdiContainer = true;
    this.radDock1.AutoDetectMdiChildren = true;
 
    this.radDock1.DockWindowAdded += radDock1_DockWindowAdded;
}
 
private void radDock1_DockWindowAdded(object sender, Telerik.WinControls.UI.Docking.DockWindowEventArgs e)
{
    HostWindow hw = e.DockWindow as HostWindow;
    if (hw != null)
    {
        hw.Image = Properties.Resources.about_paint;
        hw.Content.Text = "My text";
    }
}
 
private void radButton1_Click(object sender, EventArgs e)
{
    Form childForm = new Form();
    childForm.Text = "MDI Child " + DateTime.Now.ToShortTimeString();
    childForm.MdiParent = this;
    childForm.Show();
}



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
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
Dock
Asked by
Sacha
Top achievements
Rank 1
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or