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

Selecte a Tab Page programatically

I am using TabbedMDIManager in my application. I would like to select a tab through programatically. Here is the code for choosing a tab programatically. TabHost[] ths = this.tabbedMDIManager.TabGroupHosts; foreach(TabHost th in ths) { MDITabPanel mdiPanel = th.MDITabPanel; IEnumerator pageEnum = mdiPanel.TabPages.GetEnumerator(); while(pageEnum.MoveNext()) { TabPageExt page = pageEnum.Current as TabPageExt; if(page.Text == "Some Text") { mdiPanel.SelectedTab = page; mdiPanel.SelectedTab.Focus(); mdiPanel.BringSelectedTabToView(); break; } } } If i set a different page in MDIPanel SelectedTab, only the tab header is selected and the controls which are residing in the tab are not shown. Can you tell me, how can i overcome the problem. Thanks, Suresh Mani

3 Replies

AD Administrator Syncfusion Team March 9, 2004 11:06 AM UTC

Hi Suresh, Thanks for the code snippet. You could simply select any TabbedMDI child by using code like : this.tabbedMDIchild.Activate(); If you wish to select a particular page from a list of tabbedMDI children, then you could code as follows : foreach(Form fm in tabbedMDIManager.MdiChildren) { if (fm.Text == "some text") { fm.Activate(); } } I have also attached a sample here which illustrates the same. Please refer to it and let me know if this meets your requirements. Thanks for choosing Syncfusion products. Regards, Guru Patwal Syncfusion, Inc.


SU SureshMani March 10, 2004 02:01 AM UTC

Thanks for your reply and sample code. It is working perfectly. Thanks once again. Suresh Mani


AD Administrator Syncfusion Team March 10, 2004 11:21 AM UTC

Hi Suresh, Thanks for the update. We appreciate your continued interest in Syncfusion products. Regards, Guru Patwal Syncfusion, Inc.

Loader.
Live Chat Icon For mobile
Up arrow icon