Adding a windows.forms control to tabitem

2 posts, 0 answers
  1. iduarte
    iduarte avatar
    2 posts
    Member since:
    Jul 2007

    Posted 05 Sep 2008 Link to this post

     
    Can I, add a control by code to a tabitem, like a stardard button control, and not one that inherits from radcontrols?

    Thanks.
  2. Boyko Markov
    Admin
    Boyko Markov avatar
    610 posts

    Posted 08 Sep 2008 Link to this post

    Hi iduarte,

    Sure, you can. RadTabStrip supports two different modes of work - tab strip and tab control modes. Its default mode is tab control as the EnableHostControlMode property is true. The main difference between these two modes is that the first one is not able to host any controls in its tab items where the purpose of the second one is to host controls.
    You can add a control to a TabItem in two ways - design mode and by code:

    • Add a control to a TabItem in design mode. 
      1. Drag and Drop a new instance of RadTabStrip
      2. Add a few tab items
      3. Select a TabItem
      4. Drag and Drop a control into the surface below the TabItem. This surface represents a panel control which is the container of the controls and is associated with the tab item
    • Add a control to a TabItem by code
    1. Drag and Drop a new instance of RadTabStrip
    2. Add a few tab items
    3. Select a TabItem
    4. TabItem has the ContentPanel property which represents the container panel of the controls. ContentPanel is a bit enhanced Microsoft Panel and includes its standard behavior. So to add a control to the panel you can write: this.tabItem1.ContentPanel.Controls.Add(control)
    If you have additional questions, feel free to contact me.

    Kind regards,
    Boyko Markov
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. UI for WinForms is Visual Studio 2017 Ready
Back to Top