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.
Unfortunately, activation email could not send to your email. Please try again.

Selecte a Tab Page programatically

Thread ID:





11502 Mar 9,2004 02:37 AM Mar 10,2004 06:21 AM Windows Forms 3
Tags: Tools
Asked On March 9, 2004 02:37 AM

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

Administrator [Syncfusion]
Replied On March 9, 2004 06:06 AM

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.

Replied On March 9, 2004 09:01 PM

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

Administrator [Syncfusion]
Replied On March 10, 2004 06:21 AM

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


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.

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.