Jump to content
Xtreme .Net Talk

tabcontrol properties not working


Recommended Posts

Guest bytesighs
Posted

I have a simple tab control created at design time.

I want one of the tab pages to be disabled or not visible when the application runs the becom visib;e/ enabled after a button is clicked. It doesn't seem to work. Am I doing something wrong or is this a bug?

 

Page load event....

tabpage6.visible=false

 

 

the visible.false doesn't seem to do anything

Guest iowahawk43
Posted

Tabs are typically arrays, not individually named as your sample code shows.

 

Tab(6).Visible = False

 

Remember that arrays start numbering with 0.

  • *Gurus*
Posted
The way he was using would work, if you could actually do this. Tab strips are not meant to have their tabs hidden or disabled on the fly, nowhere in Windows does this. You need to re-evaluate your problem and come up with a better UI solution.

MVP, Visual Developer - .NET

 

Now you see why evil will always triumph - because good is dumb.

 

My free .NET Windows Forms Controls and Articles

  • 6 months later...
Posted

If somebody ever got the same problem:

 

I've solve it in this way...

TabControl1.TabPages.Remove(TabPage1) ' if You want this TabPage and it's button to be invisible
TabControl1.TabPages.Add(TabPage1) 'othervie use this

It's a bit complicated... look out for those tabs which are already added, and do not remove those which are removed

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...