We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

close tabs in TabControlAdv like in IE7

Thread ID:





59982 Apr 25,2007 06:16 PM UTC Mar 5,2008 09:39 PM UTC WinForms 6
Tags: Tools
Kamen Yotov
Asked On April 25, 2007 06:16 PM UTC

is there a way to embed an "x" button on tabs, so that they can be closed like pages are closed in IE7?

Rajesh C [Syncfusion]
Replied On April 26, 2007 02:58 AM UTC

Hi Kamen,

Thank you for using Syncfusion products.

The TabControlAdv has no direct property to display the close button for tabs. I have created a sample to achieve this feature by using the TabRendererBase class. Please refer to the code snippet.

[ C#]

TabRendererBase[] renders;

private void Form1_Load(object sender, EventArgs e)
renders=new TabRendererBase[this.tabControlAdv1.TabCount ];
for (int i = 0; i < this.tabControlAdv1.TabCount; i++)
renders[i] = this.tabControlAdv1.Renderer.Renderers[i] as TabRendererBase;
renders[i].ShowCloseButton = true;
renders[this.tabControlAdv1.SelectedIndex].HitCloseButton = true;

private void tabControlAdv1_MouseClick(object sender, MouseEventArgs e)
renders[this.tabControlAdv1.SelectedIndex].CloseButtonClicked = renders[this.tabControlAdv1.SelectedIndex].CloseButtonHitTest(new Point(e.X, e.Y));
if (renders[this.tabControlAdv1.SelectedIndex].CloseButtonHitTest(new Point(e.X, e.Y)))

Please have a look at this sample and let me know if this helps you.



Inna Golovataya
Replied On August 2, 2007 06:58 PM UTC

I'm trying to follow the example for adding Close button to the tab. I'm using version and TabRendererBase class does not have HitCloseButton property.

Can you recommed the way to implement Close button in version

Thank you,

Ajish [Syncfusion]
Replied On August 6, 2007 07:36 PM UTC

Hi Inna,

The following code of the TabRendererBase class can be used to do the same,

if (renders[this.tabControlAdv1.SelectedIndex].CloseButtonHitTest(new Point(e.X, e.Y)))

and here is a sample for your reference,

Sample: http://websamples.syncfusion.com/samples/Tools.Windows/F59982_1/main.htm

Kindly take a look and let me know if this helps.


Replied On February 28, 2008 08:20 PM UTC

Can you provide full code that can work with version. I tried hard but could nto make it work

Replied On February 29, 2008 04:25 PM UTC

Any response?
I need to show the close button on the tabs. I don't want to draw it on draw item event, because it look ugly.

Any suggestions?

>Can you provide full code that can work with version. I tried hard but could nto make it work

Administrator [Syncfusion]
Replied On March 5, 2008 09:39 PM UTC

Hi Jeepee ,

Feature: Close button on each tabs in TabControlAdv like in IE7

We have implemented this feature in v. and the later versions.. I would like to recommend you to upgrade to this version.


Unlock key :
Please contact your Syncfusion Sales Representative or e-mail salessupport@syncfusion.com.

Please let me know if you have any problem in this version.



This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon