This is a migrated thread and some comments may be shown as answers.

Close button in tab

3 Answers 127 Views
Dock
This is a migrated thread and some comments may be shown as answers.
Rob
Top achievements
Rank 1
Rob asked on 11 Jul 2011, 01:50 PM
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));

3 Answers, 1 is accepted

Sort by
0
Accepted
Stefan
Telerik team
answered on 14 Jul 2011, 11:17 AM
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!

0
Rob
Top achievements
Rank 1
answered on 14 Jul 2011, 02:16 PM
Thanks. Worked perfectly!
0
Stefan
Telerik team
answered on 19 Jul 2011, 10:07 AM
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!

Tags
Dock
Asked by
Rob
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Rob
Top achievements
Rank 1
Share this question
or