Solved

Make a tabControl visible and reorder the the way they appear

Posted on 2002-06-27
4
373 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: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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

Suggested Solutions

Title # Comments Views Activity
Formula for calculating ROI on training 6 69
jquery tab header text 1 28
Name Space error VS2015 1 36
IDE for Python 5 69
In my previous article (http://www.experts-exchange.com/Programming/Languages/.NET/.NET_Framework_3.x/A_4362-Serialization-in-NET-1.html) we saw the basics of serialization and how types/objects can be serialized to Binary format. In this blog we wi…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display

749 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