A few questions on TabControl

M

Max

I have a form in my project, which based on the user selection (probably
from a combo box) has to change its content. I guess the best way to
describe it is if I had a TabControl on that form, then depending on the
index of selected item from the combobox the corresponding tab would be
automatically shown. The problem with that method is that the user would
still have the ability to manually select the tabs, and that would cause
a few problems. I guess my main question would be, is there some way to
disable user’s ability from selecting tabs or even from knowing which
tabs exist? Like have a tabcontrol which shows tabs only during design
time, but once the program is started the tabs would disappear and the
only way of changing them would be through code.

If something like that is not exactly possible, then is there maybe some
other way to be able to design a kind of form which is able to change
its contents? I mean without setting up all the controls on one page and
then writing hundreds of lines of code to determine which are visible
and which are not.

Also if you know some 3rd party controls which may do this, please let
me know. Thanks.
 
S

Samuel L Matzen

Max,

There are two ways to approach this. I have used both.

1. Put each different set of controls on a different form. Then you can
"reparent" the form onto a panel on your main form. The trick to
reparenting a form is to set the following properties of the form.

<code (VB.NET) >
..TopLevel = False
..Dock = DockStyle.Fill
..FormBorderStyle = FormBorderStyle.None
</code>

2. Infragistics has a nice tab control as a part of its UltraWinToolbars
product. One of the styles on this controls is "wizard" where the control
does not display the tabs and you have complete control over which tab
displays.

Like I said, I have written project both ways and there really isn't much
difference.

-Sam Matzen
 

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