Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Make a tabControl visible and reorder the the way they appear

Posted on 2002-06-27
4
Medium Priority
?
380 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 80 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

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Question has a verified solution.

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

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 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…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…

636 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