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

TabControlAdv setting first page TabVisible = false

I am having a problem with the TabControlAdv. At run time I want to set which pages are visible, and which are not. However, i am having a problem, where if I set the first page visibility to false, I still see the contents of the page when the form loads. Is there a way to prevent this. Thanks, Michael Sabin

2 Replies

AD Administrator Syncfusion Team March 18, 2005 02:24 PM

Hi Michael, The problem is that setting TabVisible doesn''t affect which TabPageAdv is currently selected. Since the first TabPageAdv is selected by default, it''ll show up when you start the page. To avoid this, you''ll need to set the SelectedIndex as follows: for (int i = 0; i < this.tabControlAdv1.TabCount; ++i) { if (this.tabControlAdv1.TabPages[i].TabVisible) { this.tabControlAdv1.SelectedIndex = i; break; } } Of course, this won''t work if none of your Tabs are visible, but that shouldn''t be a problem. Hope this helps. Regards, Gregory Austin Syncfusion Inc.


AD Administrator Syncfusion Team March 18, 2005 03:31 PM

Thanks, that works >Hi Michael, > > The problem is that setting TabVisible doesn''t affect which TabPageAdv is currently selected. Since the first TabPageAdv is selected by default, it''ll show up when you start the page. To avoid this, you''ll need to set the SelectedIndex as follows: > >for (int i = 0; i < this.tabControlAdv1.TabCount; ++i) >{ > if (this.tabControlAdv1.TabPages[i].TabVisible) > { > this.tabControlAdv1.SelectedIndex = i; > break; > } >} > >Of course, this won''t work if none of your Tabs are visible, but that shouldn''t be a problem. > >Hope this helps. > >Regards, >Gregory Austin >Syncfusion Inc.

Loader.
Live Chat Icon For mobile
Up arrow icon