Solved

Make a tabControl visible and reorder the the way they appear

Posted on 2002-06-27
4
374 Views
Last Modified: 2012-06-22

Hi
I have a user control with a tabControl
In this Tab Control I have I collection of tabPages.

Eg tabAddress,tabContact,TabAppointment

What I would like to do in my user control is to have a property that makes this tabs invisible or visible and then appear in the order I want.
Any help with an example will be appreciated!

I thought of  this in the user control but this will make the all control visible how can I make it so that only a particular tab is visible?

Public Property IsVisible() As Boolean
        Get
            Return mbIsVisible
        End Get
        Set(ByVal Value As Boolean)
            mbIsVisible = Value
        End Set
    End Property

Thanks
Gabriel
0
Comment
Question by:Gabriel_Brienza
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 4

Accepted Solution

by:
kpkp earned 20 total points
ID: 7113937
How about adding a second tab control to you control, tabControl2.  Make tabControl.Visible = false.  

You could then move the tab that you want to hide to it, and move it back to make it visible again.  This way you can still create your tab pages at design time using the ide.

System.Windows.Forms.TabPage pageToHide = tabControl1.TabPages[0];
tabControl2.TabPages.Add(pageToHide);
tabControl1.TabPages.Remove(pageToHide);

System.Windows.Forms.TabPage pageToShow = tabControl2.TabPages[0];
tabControl1.TabPages.Add(pageToShow);
tabControl2.TabPages.Remove(pageToShow);




Of course you could use your own collection (hashtable or something) to store the TabPages, you don't have to create an second invisible tab control.

0
 

Author Comment

by:Gabriel_Brienza
ID: 7114086
Thanks for your reply.
But i think your idea could work however I am told to make a particular page in my tabcontrol visible of invible and reorder them when the developer uses my control.Ideally I should not be using 2 tabs.
Is this the only way to do it ?
How about to make that particular page visible or invisible by setting only a property.How could i do that in my usercontrol?
Sorry for being difficult

Thanks
Gabriel
0
 
LVL 4

Expert Comment

by:kpkp
ID: 7115736
if you make the second tab invisible, but setting its visible property to false, you should get the same effect, you would only see one tab control on the screen
0
 

Author Comment

by:Gabriel_Brienza
ID: 7190082
I think at moment this is the only way to make the tabs work.
Thanks for your help
Gabriel
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A basic question.. “What is the Garbage Collector?” The usual answer given back: “Garbage collector is a background thread run by the CLR for freeing up the memory space used by the objects which are no longer used by the program.” I wondered …
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

691 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question