Customize Tabs

Hi,

We are using the following function to create tabs in our application:
public virtual void DockControl(
Control ctrl,
Control parent,
DockingStyle dockstyle,
int nsize
);

with dockstyle as DockingStyle.Tabbed.
How can I customize the tabs created, like adding an icon or coloring it differently. What I would also like to do is add an icon to close the particular tab.

Thanks alot,
regards,
Nitin Mehra.

12 Replies

RS Rajarajeswari S Syncfusion Team August 10, 2007 02:21 PM UTC

Hi,

Thank you for using Syncfusion products.

Please refer the simple sample in the below link that I created that shows customized tabs. In it, I have created three panels named as PanelA, PanelB, and PanelC respectively and these all are docked using Docking Manager. Also, I have used an Imagelist with necessary icons and binded it with DockingManager so that we can select the appropriate icons for the caption buttons.This sample is similar to sample browser CustomcaptionButton sample, but here you can see different icons for the caption buttons.

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

Kindly let me know if you have any other concerns.

Regards,
S.Rajarajeswari


NM nitin mehra August 16, 2007 04:55 PM UTC

Hi,

I am unable to open the solution that u have sent.


RR Ramya R Syncfusion Team August 17, 2007 02:12 PM UTC

Hi Nitin,

There were some problems with the link. It is corrected now.

Kindly check it and let me know if you have any problems.

Thanks,
Ramya.


NM nitin mehra August 17, 2007 03:55 PM UTC

SuperToolTipEditor.Designer.cs is missing.

Also I am getting Syncfusion.Windows.Forms.Tools.CaptionButton
Syncfusion.Windows.Forms.Tools.CaptionButtonsCollection

as unresolved.

Thanx
Regards
nitin


RR Ramya R Syncfusion Team August 20, 2007 09:01 AM UTC

Hi Nitin,

Thank you for the update.

1. SuperToolTipEditor.Designer.cs is missing.

I have attached the sample here below with SuperToolTipEditor.Designer.cs file.

You can download the sample from the below link,
http://websamples.syncfusion.com/samples/Tools.Windows/F67091/main.htm

2. Also I am getting Syncfusion.Windows.Forms.Tools.CaptionButton Syncfusion.Windows.Forms.Tools.CaptionButtonsCollection as unresolved.

I checked for this error using v5.1.0.51 but I did not get any such error.

Could you please let me know which version of Essential Studio you are using, so that we can check for this error in that version and try to provide you with a solution?

Thanks & Regards,
Ramya.



NM nitin mehra August 20, 2007 05:54 PM UTC

Hi,

I am using the 4.2.0.37 version
I found the CaptionButton under the
Syncfusion.Windows.Forms.Tools.Renderers namespace however there is no CaptionButtonsCollection type.

Will I be able to do the same whatever you have in the version that I have.

thanks alot,
regards,
Nitin Mehra.


RR Ramya R Syncfusion Team August 21, 2007 07:36 AM UTC

Hi Nitin,

Thank you for the update.

The feature of CustomCaptionButtons and setting icon for CaptionButtons were implemented in our latest version5.1.0.51.

It is not possible to perform a similar functionality in v4.2.0.37.

Could you please try to upgrade to our latest version?

Kindly refer the below link for our latest version download,
http://www.syncfusion.com/downloads/latestversion/default.aspx

Unlock key:

If you hold a Syncfusion license with a valid subscription, you can obtain your key for this version by visiting the "Download the latest versions" section within Direct-Trac and clicking on the appropriate key icon. If you are currently evaluating our products or considering renewing an expired subscription, please write to [email protected] to request a key.

Please let me know if you have any queries.

Thanks & Regards,
Ramya.


NM nitin mehra August 24, 2007 02:25 AM UTC

Hi,

Can I add a context menu to the tabs appearing in the docked windows in syncfusion 4. I could probably use this to close windows or some other actions

rgds,
nitin mehra


J. J.Nagarajan Syncfusion Team August 25, 2007 12:46 AM UTC

Hi Nitin,

Thanks for your continued interest in Syncfusion product.

If you want to add a context menu in DockTabs then please refer to the following code snippet

DockTabControl tabcontrol;
void dockingManager1_NewDockStateEndLoad(object sender, EventArgs e)
{
//to change the tab order
DockHost dhost2 = this.Tasks.Parent as DockHost;
DockHostController dhc = dhost2.InternalController as DockHostController;
if ((dhc.ParentController != null) && (dhc.ParentController is DockTabController))
{
DockTabController dtc = dhc.ParentController as DockTabController;
tabcontrol = dtc.TabControl as DockTabControl;
TabPageAdv tab1 = tabcontrol.TabPages[0];
TabPageAdv tab2 = tabcontrol.TabPages[1];
tabcontrol.ContextMenuStrip = this.contextMenuStrip1;
}
}

private void exitToolStripMenuItem_Click(object sender, EventArgs e)
{
tabcontrol.SelectedTab.Hide();
}

I have attached the sample that demonstrates this completely. You can download the sample from the following page.

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

Please refer to the sample and let me know if you have any questions.

Regards,
Nagaraj


NM nitin mehra September 5, 2007 07:52 PM UTC

But I believe this requires syncfusion 5. I need to do the same with syncfusion 4.2.0.37.
Can I do it


NM nitin mehra September 5, 2007 07:52 PM UTC

But I believe this requires syncfusion 5. I need to do the same with syncfusion 4.2.0.37.
Can I do it


J. J.Nagarajan Syncfusion Team September 6, 2007 06:29 PM UTC

Hi Nitin,

You can add the context menu in Dock tabs and you can remove the selected tabs through the context menu. Please refer to the following code snippet

DockTabControl tabcontrol;
private void dockingManager1_NewDockStateEndLoad(object sender, EventArgs e)
{
DockHost dhost = this.xpTaskBar2.Parent as DockHost;
dhost.Text = "Tasks & Categories";
DockHost dhost1 = this.treeView1.Parent as DockHost;
dhost1.Text = "Tasks & Categories";

////to change the tab order
DockHost dhost2 = this.xpTaskBar2.Parent as DockHost;
DockHostController dhc = dhost2.InternalController as DockHostController;
if ((dhc.ParentController != null) && (dhc.ParentController is DockTabController))
{
DockTabController dtc = dhc.ParentController as DockTabController;
tabcontrol = dtc.TabControl as DockTabControl;
TabPageAdv tab1 = tabcontrol.TabPages[0];
TabPageAdv tab2 = tabcontrol.TabPages[1];
tabcontrol.ContextMenuStrip = this.contextMenuStrip1;

}
}

private void removeToolStripMenuItem_Click(object sender, EventArgs e)
{
tabcontrol.SelectedTab.TabVisible = false;
}

I have attached the sample and you can run this sample in v.4.2 successfully. You can download the sample from the following page.

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

Please refer to the sample and let me know if you have any questions.

Regards,
Nagaraj

Loader.
Up arrow icon