Solved

Make a tabControl visible and reorder the the way they appear

Posted on 2002-06-27
4
369 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
  • 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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Normally the drop down box control found in the .Net framework tools is able to select just one data and value at a time, which is displayed on the text area.   But what if you want to have multiple values to be selected in the drop down box? As …
This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

707 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now