Close button in tab

4 posts, 1 answers
  1. Rob
    Rob avatar
    11 posts
    Member since:
    Apr 2011

    Posted 11 Jul 2011 Link to this post

    How can I get a close button in the tabs for document windows in RadDock? Similar to how Firefox has implemented them. I was able to do it in RadPageView by doing something like the following, just not sure where it goes in the tree for a DocumentWindow.

    RadButtonElement radB = new RadButtonElement();
    radB.MaxSize = new Size(15, 15);
    radB.Click += new EventHandler(control.CloseTabButtonClicked);
    radB.Font =
      new System.Drawing.Font("Verdana", 7, FontStyle.Regular, GraphicsUnit.Point, ((Byte)0));
    radB.Text = "X";
    radB.TextElement.Location = new Point(1, 0);
    radB.Margin = new Padding(0);
    radB.TextAlignment = ContentAlignment.TopLeft;
    radB.Alignment = ContentAlignment.MiddleRight;
    tabItem.Children[2].Margin = new Padding(0, 0, 20, 0);
    tabItem.Children.Add(radB));
  2. Answer
    Stefan
    Admin
    Stefan avatar
    2890 posts

    Posted 14 Jul 2011 Link to this post

    Hi Rob,

    Thank you for writing.

    You can achieve the desired functionality by setting just one property of RadDock - ShowDocumentCloseButton. Please refer to the following help article for a sample code: Tabs and Captions.

    I hope that you find this information helpful. Should you have any other questions, do not hesitate to contact us.
     
    Greetings,
    Stefan
    the Telerik team

    Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

  3. UI for WinForms is Visual Studio 2017 Ready
  4. Rob
    Rob avatar
    11 posts
    Member since:
    Apr 2011

    Posted 14 Jul 2011 Link to this post

    Thanks. Worked perfectly!
  5. Stefan
    Admin
    Stefan avatar
    2890 posts

    Posted 19 Jul 2011 Link to this post

    Hi Rob,

    I am glad that I could help. If you have any other questions, do not hesitate to contact us.
     
    All the best,
    Stefan
    the Telerik team

    Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

Back to Top