Style of tabs in tabbed document

5 posts, 1 answers
  1. Dudu
    Dudu avatar
    3 posts
    Member since:
    Jul 2013

    Posted 16 Jul 2013 Link to this post

    Hi,
    please is there any way to reach result attached in the second picture programatically ? The tab is aligned to bottom.

    1) I would need to get close button to the right of the tab name
    2) I would need to get rid of close button at one tab.

    First picture describes current state. Second picture shows my wish.

    Thanks
  2. Stefan
    Admin
    Stefan avatar
    2891 posts

    Posted 17 Jul 2013 Link to this post

    Hello Dudu,

    Thank you for writing.

    For the time being, the tabs in the DocumentWindows of RadDock cannot be replaced, and having in mind that the layout of the tab is custom one, it is not possible to move the close button and also it is not possible to add another element in the tab. Since this seems a reasonable request, I am adding it in our 
    Public Issue Tracking System. You can add your vote for it here: http://www.telerik.com/support/pits.aspx#/public/winforms/15384

    I hope that you find this information useful.
     

    Regards,
    Stefan
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WINFORMS.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Dudu
    Dudu avatar
    3 posts
    Member since:
    Jul 2013

    Posted 18 Jul 2013 Link to this post

    Thank you,
    i have one more question. In Visual Style Builder i have found button for adding new documents. How can i display him programatically, please? It is shown in enclosed picture.
  5. Answer
    Stefan
    Admin
    Stefan avatar
    2891 posts

    Posted 23 Jul 2013 Link to this post

    Hello,

    You can do that by setting the NewItemVisibility property of the desired DocumentTabStrip. To handle newly created srtips which might get automatically created during a drag and drop operation, you can use the PageViewInstanceCreated event. Here is a small sample of this approach:
    public partial class Form2 : Form
    {
        public Form2()
        {
            InitializeComponent();
     
            this.documentTabStrip1.TabStripElement.NewItemVisibility = Telerik.WinControls.UI.StripViewNewItemVisibility.End;
     
            this.documentTabStrip1.TabStripElement.NewItem.Click += new EventHandler(NewItem_Click);
     
            this.radDock1.PageViewInstanceCreated += new PageViewInstanceCreatedEventHandler(radDock1_PageViewInstanceCreated);
        }
     
        void radDock1_PageViewInstanceCreated(object sender, PageViewInstanceCreatedEventArgs e)
        {
            RadPageViewStripElement strip = (RadPageViewStripElement)e.PageViewElement;
            strip.NewItemVisibility = StripViewNewItemVisibility.End;
            strip.NewItem.Click += new EventHandler(NewItem_Click);
        }
     
        void NewItem_Click(object sender, EventArgs e)
        {
            AddTab("New Tab " + DateTime.Now.TimeOfDay);
        }
     
        private void AddTab(string title)
        {
            RadLabel label = new RadLabel();
            label.Text = "label " + title;
            var f = new ToolWindow
            {
                Text = title,
            };
            f.Controls.Add(label);
     
            radDock1.SetWindowState(f, DockState.TabbedDocument);
        }
    }

    I hope this helps.
     

    Regards,
    Stefan
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WINFORMS.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  6. Dudu
    Dudu avatar
    3 posts
    Member since:
    Jul 2013

    Posted 24 Jul 2013 Link to this post

    Hi,
    yes it helped me very much. Thank you.
Back to Top
UI for WinForms is Visual Studio 2017 Ready