Does TabPage.Visible work properly?

K

Kevin Z Grey

Heya,

I'm attempting to programatically disable a TabPage
from a TabControl and make it invisible without altering
the indices of the TabPages. The TabPage.Visible property
does not appear to be functional in the CF.

On top of this problem I've found that the TabPage
indices do not get updated after removing a TabPage from
the TabControl. This *looks* like a bug to me
(Disclaimer: this does not mean it is :p ).

Can anyone help me with this problem? I need a fail-
proof way of making a TabPage invisible without removing
it from the TabControl AND/OR referencing a TabPage by its
index (or better yet, by its Text value since thats the
way it should be!).

Please let me know if I need to clarify. Thanks in
advance!

~~K
 
J

John T

Kevin Z Grey said:
Can anyone help me with this problem? I need a fail-
proof way of making a TabPage invisible without removing
it from the TabControl AND/OR referencing a TabPage by its
index (or better yet, by its Text value since thats the
way it should be!).

How about removing the tab from the parent's Tabs property? I'm not in
front of my development PC to test this, but it should be the opposite of
the Add method call in InitializeControls():

tabParent.Tabs.Remove(myTabPage);
 
X

Xin Yan

Hi, Kevin
From MSDN on TabPage.Visible Property
This member supports the .NET Framework infrastructure and is
not intended to be used directly from your code.
So I will not call it from my code.

Doing tabParent.Tabs.Remove seems to be a good solution.
Hope this helps
Xin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top