Tab control functionality - but with no tabs

R

Rob Oldfield

Hi,

I would like to build an app where my main form can take on various
different layouts depending on choices made by the user. In fact, it would
be very similar to how a tab control works... if user does action a, then
make tab x visible, if action b, then make tab y visible etc.

But I don't want to have the tabs visible. Any ideas?

(Having Googled for a solution, I'm aware of the options of moving the tabs
to a hidden tab control type solution... but when they come back, they'll
still show up with a tab. Which I don't want.)
 
K

Ken Halter

Rob Oldfield said:
Hi,

I would like to build an app where my main form can take on various
different layouts depending on choices made by the user. In fact, it
would
be very similar to how a tab control works... if user does action a, then
make tab x visible, if action b, then make tab y visible etc.

But I don't want to have the tabs visible. Any ideas?

(Having Googled for a solution, I'm aware of the options of moving the
tabs
to a hidden tab control type solution... but when they come back, they'll
still show up with a tab. Which I don't want.)

You can use any container control for this. Basically the same as (in VB6),
dropping a few frames on a form, setting them all Visible = False and
showing only the one that's appropriate for the selected options. This is
basically the same as the Microsoft Windows Common Controls TabStrip
component. That TabStrip is nearly impossible to work with without a set of
frames (or other container controls)... All that TabStrip is, is a
specialized option button (radio button) and exposes a convenient way for a
user to tell the app which frame they want to see. There's zero support for
showing/hiding anything at all when using the TabStrip..... so, that means,
it's easy to do without it <g>
 
R

Rob Oldfield

Yes. That's the issue. I could set up a bunch of frames and make the
relevant one visible as required - but the problem obviously is the general
horribleness of trying to design the UI using that technique. Thinking
about it in that way, I think the best plan will be to do the design while
using different frames on a tab control. At runtime, hide the tab controls
and then programatically remove the relevant frame from the tab and make it
visible.

Seems workable, if a bit of a major kludge.

Anyone have anything better?
 
H

Herfried K. Wagner [MVP]

Rob Oldfield said:
Yes. That's the issue. I could set up a bunch of frames and make the
relevant one visible as required - but the problem obviously is the
general
horribleness of trying to design the UI using that technique. Thinking
about it in that way, I think the best plan will be to do the design while
using different frames on a tab control.

You could create usercontrols for each of the views. Then each of the views
can be edited in its own designer and you can easily place the usercontrols
on the form.
 
R

Rob Oldfield

Herfried K. Wagner said:
You could create usercontrols for each of the views. Then each of the views
can be edited in its own designer and you can easily place the usercontrols
on the form.

That does sound like a more elegant idea. I've been playing with the method
I described before and it's not that bad, but I think I shall also try it
your way (I haven't played with user controls in anger before... perhaps now
is the best time to try)

Many thanks to both of you.
 
M

Mick Doherty

How about a Tabless TabControl?
See the PanelManager Class on my site:
http://www.dotnetrix.co.uk/custom.html

There are some issues at DesignTime in VS2005 due to some newly introduced
bugs with the CollectionEditor and ReferenceConverter, but it works fine in
VS2003.

In VS2005 it seems to work OK if you build it in it's own solution, but not
if it's a seperate project in the same solution as your app. The downside to
this is that you'll need to distribute a seperate dll, but then if you have
several custom controls they can all be built into the same ControlLibrary.
 
R

Rob Oldfield

Can't see any reference to a PanelManager class. You're talking about
TabControlEx?

"Mick Doherty"
 
M

Mick Doherty

No.
The PanelManager source can be found on my "Tips --> Custom Controls" page.
 
R

Rob Oldfield

Missed that one. I'll be trying that as well (and probably the MenuSkinner
as well).

Thanks.


"Mick Doherty"
 

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