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.htmPlease refer to the sample and let me know if you have any questions.
Regards,
Nagaraj