hide the tab of tabpage

E

Esmail Bonakarian

Hello all,

I have a tabcontrol with 3 tabpages. I want to
hide (not just disable) the 3 actual selection tabs that
allow a user to select a given tab page, but keep the
page around and active.

Instead I will be changing the current tabpage shown
programmatically.

I haven't found a way to do this, but I don't know
that much about windows forms (yet ;-)

I am currently implementing this behavior with the
use of one form and 3 panels, however someone suggested
the use of a TabControl, which is nice and gives me most
of the functionality I need, but unless I can get rid
of (ie make invisible) the actual selection tabs I'll
have to stick to my 1 Form + 3 Panels idea.

... is it possible to hide just the selection tab of
a tab page?

thanks,
Esmail
 
T

Tim_Mac

hi esmail
i used to do something similar, and i would move the tab control off the top
of the form, or else hide it behind another control, so the tab selectors
would not be visible, but the actual content pane for each tab page are
visible. then you control the current tab programatically as you have
suggested. i was using this to make a kind of wizard control, but there are
great free wizard controls out there if this is what you are using it for.

tim
 
E

Esmail Bonakarian

hello!
i used to do something similar, and i would move the tab control off the top
of the form,

I hadn't though of that .. I just tried in the designer, it wouldn't
allow me to do so, so you must have coded it to do that right?
or else hide it behind another control, so the tab selectors
would not be visible, but the actual content pane for each tab page are
visible.

tried that just now too, and that works ... I'll have to remember that
technique.
then you control the current tab programatically as you have
suggested. i was using this to make a kind of wizard control, but there are
great free wizard controls out there if this is what you are using it for.

what are wizard controls? I think at this point I have the "one form,
several panels" approach working, but still curious.

Thanks,
Esmail
 
T

Tim_Mac

hi Esmail,
the best wizard control i know of is on codeproject, written by Al Gardner:
http://www.codeproject.com/cs/miscctrl/DesignTimeWizard.asp

a wizard control is used when you have a sequence of steps to perform, and
you want to display some user interface components at each step. i use one
when i am loading up my windows forms content management system, first
page/tab is for login, then another for checking passwords, downloading
data, running integrity check etc.
it has built-in Next/Previous buttons and you can control it all
programatically if you want to. it's very good.

i think it is a valuable control to have available to you if you write
windows forms applications.

tim
 
M

Mick Doherty

I wrote a PanelManager Class specifically for this. If you want to use it in
VS2005 then you'll have to build and compile the control in a seperate
solution, as there are design time bugs with CollectionEditors in VS2005
that make it harder to work with than just stacked panels when the class is
included in the solution (even if in a seperate project). MS are currently
working on a solution to this bug.

You can see the code on my site:
http://www.dotnetrix.co.uk/custom.html
 
T

Tim_Mac

if you have comments on the wizard control, ask the auther on codeproject
via the 'comments' at the bottom of the page.
also, please only reply to the newsgroups.
 
E

Esmail Bonakarian

Tim_Mac said:
if you have comments on the wizard control, ask the auther on codeproject
via the 'comments' at the bottom of the page.
also, please only reply to the newsgroups.

fair enough, thanks!

Esmail
 
E

Esmail Bonakarian

Mick said:
I wrote a PanelManager Class specifically for this. If you want to use it in
VS2005 then you'll have to build and compile the control in a seperate
solution, as there are design time bugs with CollectionEditors in VS2005
that make it harder to work with than just stacked panels when the class is
included in the solution (even if in a seperate project). MS are currently
working on a solution to this bug.

You can see the code on my site:
http://www.dotnetrix.co.uk/custom.html

Hello there,

Thanks for the pointer/link.

I went to your the site, copied the C# code, and dumped it
into a PanelManger.cs file in my project directory, and it compiled
fine and it shows up nicely in the solution explorer.

I also added a reference to System.Design .. should I
expect this control now to show up in the toolbox? No
such luck yet.

I feel I am missing a simple step or two, could you
tell me what I need to do to make the control available?

As someone who has coded primarily under Linux w/ emacs
and gcc/g++ I am still a bit bewildered by all the various
files that get "automagically" generated by VS.NET

I like the VS environment, but it's taking some time to
get used to all of its features.

Thanks,

Esmail
ps: your site looks interesting, I'm going to poke around
there some more.
 
M

Mick Doherty

Esmail Bonakarian said:
Hello there,

Thanks for the pointer/link.

I went to your the site, copied the C# code, and dumped it
into a PanelManger.cs file in my project directory, and it compiled
fine and it shows up nicely in the solution explorer.

I also added a reference to System.Design .. should I
expect this control now to show up in the toolbox? No
such luck yet.

I feel I am missing a simple step or two, could you
tell me what I need to do to make the control available?

As someone who has coded primarily under Linux w/ emacs
and gcc/g++ I am still a bit bewildered by all the various
files that get "automagically" generated by VS.NET

I like the VS environment, but it's taking some time to
get used to all of its features.

Thanks,

Esmail
ps: your site looks interesting, I'm going to poke around
there some more.

You'll need to right click on the toolbox and select Add items... then
browse to the exe file of your app and select it.

Alternatively, you can take advantage of the automagical adding of
usercontrols to the toolbox, just comment out the code, leaving just the
namespace and class, and then change inheritance from Control to
UserControl. Open and close the Control Designer and change everything back,
then rebuild. The PanelManager Control will now be in the 'My UserControls'
toolbox. Note: this only works pre 2005.
 
E

Esmail Bonakarian

Alternatively, you can take advantage of the automagical adding of
usercontrols to the toolbox, just comment out the code, leaving just the
namespace and class, and then change inheritance from Control to
UserControl. Open and close the Control Designer and change everything back,
then rebuild. The PanelManager Control will now be in the 'My UserControls'
toolbox. Note: this only works pre 2005.


Very cool .. thanks!!

(I'm still using VS 2003/.NET 1.1 .. though I recently downloaded the
freebie version of VS 2005 C# Express).

Happy New Year.

Esmail
 

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