How do I change tab from code?

2 posts, 0 answers
  1. Per
    Per avatar
    116 posts
    Member since:
    Jan 2008

    Posted 04 Aug 2009 Link to this post

    Hi!

    I have a main form that is set to contain MDI child forms.
    In this form I have added a dock control and set it to auto detect mdi.
    I then add mdi childs to the main form and the dock control displays them as tabs, perfect :)

    But.... How can I change active tab from source code?

    (I'm using 2009 Q2 SP1)

    Regards
    Per
     
  2. Boryana
    Admin
    Boryana avatar
    330 posts

    Posted 05 Aug 2009 Link to this post

    Hi Per,

    Thank you for contacting us. Please, refer to the following snippet:

    this.radDock1.ActivateWindow(this.radDock1.DockWindows[2]);  
    //or  
    this.radDock1.ActivateWindow((DockWindow)MDIChildForm.Parent);  

    The first approach activates the DockWindow that contains the given MDIChildForm using index. A more convenient approach uses the MDIChildForms parent, which in the current situation is the DockWindow that contains the MDIChildForm.

    I hope this is helpful. If you have further questions, do not hesitate to contact me back.

    Kind regards,
    Boryana
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. UI for WinForms is Visual Studio 2017 Ready
Back to Top