Change RadDock TabStrip at Runtime

2 posts, 0 answers
  1. Sacha
    Sacha avatar
    5 posts
    Member since:
    Mar 2019

    Posted 24 Apr 2019 Link to this post

    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 !

     

     

  2. Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    4004 posts

    Posted 25 Apr 2019 Link to this post

    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.
Back to Top