How to disable a Tabpage ?

S

Stan Sainte-Rose

Hi,
I've a Tabcontrol and I 'd like to disable a tabpage
I try to use the hide and visible property but it doesn't work.
Thx
Stan
 
E

EricJ

you can use tabpage.enabled = false but you can still open the tabpage (all
the controls should be disabled)
dont know if that is enough for you ?

eric
 
C

Chris Dunaway

Hi,
I've a Tabcontrol and I 'd like to disable a tabpage
I try to use the hide and visible property but it doesn't work.
Thx
Stan

The Hide and Visible properties don't work. In order to hide a tab, you
need to keep a hidden tabcontrol and just move the tab pages from one to
the other. It's a pain, but unless it's fixed in Whidbey, I guess we'll
have to live with it.
 
M

Mat

USE ADD and remove methods..

Chris Dunaway said:
The Hide and Visible properties don't work. In order to hide a tab, you
need to keep a hidden tabcontrol and just move the tab pages from one to
the other. It's a pain, but unless it's fixed in Whidbey, I guess we'll
have to live with it.

--
Chris

To send me an E-mail, remove the underscores and lunchmeat from my E-Mail
address.
 
C

Chris Dunaway

USE ADD and remove methods..

Yes, but if you remove a tab page, you've got to store it somewhere, either
in a collection of some sort or, as I said, another tabcontrol.
 
J

Jay B. Harlow [MVP - Outlook]

Chris,
If you use the VS.NET Forms designer to design your form, the tabpage will
be an instance field of the form itself, if the tabpage is an instance field
of the form itself, then the form is 'storing it', why do you feel it needs
to be stuffed into a second tab control?

Even if I was not using the forms designer I would simply have an instance
field to store the tabpage in when I removed it a tab control.

Have you tried the above and are having problems with it?

Hope this helps
Jay
 
S

Stan Sainte-Rose

I thank you very much,
It seems it works fine.. Using the Add and Remove Methods..

Stan
 

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

Similar Threads


Top