Tabcontrol for pocket pc - .NET Compact Framework

C

Claudio Menezes

Hi all,

I am creating an application for Pocket Pc with VB.NET, and I need to
enable and disable the tabpages individually in the tabcontrol.

Anyone could help me? I need a lot to solve this problem.

Thks
 
R

Richard Thombs

Hi all,

I am creating an application for Pocket Pc with VB.NET, and I need to
enable and disable the tabpages individually in the tabcontrol.

Anyone could help me? I need a lot to solve this problem.

Lol, I asked this question this week too. Unfortunately it looks like it
can't be done. You have to remove the tabs from the tab control if you
don't want them displayed. Which is pretty easy, but putting them back in
again is a PITA because there is no 'InsertAt' method.

Richard.
 
I

Ignacio Machin \( .NET/ C# MVP \)

Hi Claudio

AFAIk that is not possible, You can do one of several things:

1- Remove the page from the tab, you have to put it back and it may be a
problem :) ( see other post in the thread )
2- Intercept the PageChanged event and if the selected page is the one
disabled just select back the one that was before ( you may need to keep a
reference to the previously selected

3- You could create an image and place it above the tab page index, this
will hide the disabled page and still make the others accesible hence
creating the impression that it's "disabled"


I think that the third one is the best one, still it the one that may takes
more code :)

Cheers,
 
M

Mark Dykun

Removing the tab is the easiest to do. create an inherited tab page control
adding the appropiate property. Create an arraylist putting the tabpages
into it. catch the event on the tabpage and when the visible property
changes, remove all of the tabpages from tab control, walk through the
list setting the visible tabs parent to the tab control.

This should work for you.
Mark Dykun
 
A

Alex Pavloff

Lol, I asked this question this week too. Unfortunately it looks like it
can't be done. You have to remove the tabs from the tab control if you
don't want them displayed. Which is pretty easy, but putting them back in
again is a PITA because there is no 'InsertAt' method.

Agreed.

FWIW, the full .NET Framework has this exact same "issue".
 

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