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. Image for the cookie policy date

Tabbed controls siblings

Is there a way to find out if a control is tabbed and which are its siblings?

1 Reply

PS Prakash S Syncfusion Team February 13, 2003 01:23 PM UTC

Hi Bruno, There isn't an API to determine the tabbed state, but you can do so by directly accessing some of the internal docking windows classes. The following code tests whether the dockable control 'listBox1' is in a tabbed dock group, and if so, lists out all controls in that group. Trace.Assert(this.dockingManager1.GetEnableDocking(this.listBox2)); Syncfusion.Windows.Forms.Tools.DockHost dhost = this.listBox2.Parent as Syncfusion.Windows.Forms.Tools.DockHost; Syncfusion.Windows.Forms.Tools.DockHostController dhc = dhost.InternalController as Syncfusion.Windows.Forms.Tools.DockHostController; if(dhc.ParentController is Syncfusion.Windows.Forms.Tools.DockTabController) { Trace.WriteLine("Control is docked as a tab"); Syncfusion.Windows.Forms.Tools.DockTabControl docktab = (dhc.ParentController as Syncfusion.Windows.Forms.Tools.DockTabController).TabControl; foreach(DockTabPage tabpage in docktab.TabPages) { Control siblingcontrol = tabpage.dhcClient.HostControl.Controls[0]; Trace.WriteLine(siblingcontrol.Name); } } Prakash Syncfusion

Live Chat Icon For mobile
Up arrow icon