Can tab pages in a tab control can be individually enabled or disabled?

95 pts.
Tags:
VB.NET
VB.NET 2005
In my project developed using VB.NET 2005 there is a tab control with 4 tab pages. I need to call a method which will enable/disable those tab pages according the some boolean values referring to each tab page. For example if boolean value 1 is true the tab page 1 is enabled and users can operate it. 
I tried this on code but there's no Enabled property for tab pages. So is it possible in an alternative way? If it's possible how?


Software/Hardware used:
VB.NET 2005

Answer Wiki

Thanks. We'll let you know when a new response is added.

I don’t know of a way to disable tabs, but you could remove them from the tab pages collection and add them back as needed.

Something like this:

<pre> ‘Store the tab in a variable before removing it
some_page = TabControl1.TabPages(0)
‘Remove it
TabControl1.TabPages.Remove(TabControl1.TabPages(0))</pre>

<pre> ‘Insert the tab into the collection. This will insert it into the first position
‘If the tab order is not important, you could use the Add method instead
TabControl1.TabPages.Insert(0, some_page)</pre>

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • Muhammadalam
    we have 4 tabpages in our mdi child form1. we want to click on main form btton then the control transfer to the tab page2 on child form.how we do that ?
    10 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following