overlapping controls in tab

3 posts, 0 answers
  1. Ken
    Ken avatar
    5 posts
    Member since:
    Aug 2008

    Posted 24 Apr 2009 Link to this post

    *Edit* I meant to post this in tabstrip not toolstrip.
    I have a tab that includes a dynamically created radpanel and tabstrip, I'm having problems with the panel and tabsstrip overlapping.

        Private Sub AddTab() 
            'Add tab to Form 
             
            myTab.Children(2).Margin = New Padding(0, 0, 25, 0) 
            myTab.Children.Add(newButton()) 
            myTab.IsSelected = True        
            myTab.ContentPanel.Controls.Add(myTreePanel) 
            myTab.ContentPanel.Controls.Add(myTabStrip) 
            
            myTreePanel.Location = New System.Drawing.Point(0, 0) 
            myTreePanel.Dock = System.Windows.Forms.DockStyle.Left 
                   
            myTabStrip.Location = New System.Drawing.Point(129, 0) 
            myTabStrip.Dock = DockStyle.Fill 
            myTabStrip.Items.Add(innerTab) 
     
            innerTab.Children(2).Margin = New Padding(0, 0, 25, 0) 
            innerTab.Children.Add(newButton()) 
            innerTab.IsSelected = True 
     
        End Sub 

  2. Nikolay
    Admin
    Nikolay avatar
    1803 posts

    Posted 27 Apr 2009 Link to this post

    Hello Ken,

    Thank you for the question.

    In WinForms, when you want to have a layout where one of the controls is docked to left and the other is filling the remaining space, you should first the control that fills the available space and then the control that is docked to left:
    myTab.ContentPanel.Controls.Add(myTabStrip)  
    myTab.ContentPanel.Controls.Add(myTreePanel) 

    I hope this helps. If you have additional questions, feel free to contact me.

    Kind regards,
    Nikolay
    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
  4. Ken
    Ken avatar
    5 posts
    Member since:
    Aug 2008

    Posted 27 Apr 2009 Link to this post

    Thanks, that works.

    -Kenny
Back to Top