none
TabControl - Disable/Enable tab page

    General discussion

  • I have a tabcontrol with 2 pages. OnLoad the 2nd Tabpage shall be disabled (grayed out and not selectable). Later with code I need to enable the 2nd tab. Any Ideas how this can be done? please.

    /Morten
    Wednesday, May 25, 2005 8:27 AM

Answers

  • You can't disable a tab as such, but you could mimic it.

    You could do something like the following:

    1. Add a TabControl with 2 pages
    2. Set DrawMode to OwnerDrawFixed
    3. Attach the TabControl.Selecting event to tabControl1_Selecting
    4. Attach the TabControl.DrawItem event to tabControl1_DrawItem
    5. Then copy the following code into your form (you will have to change it a little)


      public Form1()
      {
       InitializeComponent();

       tabPage2.Enabled = false;

      }
      private void tabControl1_Selecting(object sender, TabControlCancelEventArgs e)
      {
       if (!e.TabPage.Enabled)
       {
        e.Cancel = true;
       }
      }

      private void tabControl1_DrawItem(object sender, DrawItemEventArgs e)
      {
       TabPage page = tabControl1.TabPages[e.Index];

       if (!page.Enabled)
       {
        using (SolidBrush brush = new SolidBrush(SystemColors.GrayText))
        {
         e.Graphics.DrawString(page.Text, page.Font, brush, e.Bounds);
        }
       }
       else
       {
        using (SolidBrush brush = new SolidBrush(page.ForeColor))
        {
         e.Graphics.DrawString(page.Text, page.Font, brush, e.Bounds);
        }
       }
      }


     



    Basically what you are doing is drawing your own tabs. You are disabling the TabPage in your constructor - be aware that the TabPage.Enabled is not visible in the designer or intellisense - but it does exist.

    Then in the selecting event you are stopping the focus from changing to a disabled page. In the DrawItem you are drawing the tabs yourself, so that you can mimic the disabled tab.

    This is not a complete solution, but it will get you started.

    HTH

    David

    Wednesday, May 25, 2005 11:13 AM
    Moderator
  • It's not a shortcoming of the control as its actually by design. A disabled tab page can be confusing to a user.

    Anyway, did you actually try using the code I post above?

    Setting TabPage5.Enabled = false, is not enough, you also need to do the things that I posted above.
    Saturday, May 28, 2005 8:19 PM
    Moderator

All replies

  • You can't disable a tab as such, but you could mimic it.

    You could do something like the following:

    1. Add a TabControl with 2 pages
    2. Set DrawMode to OwnerDrawFixed
    3. Attach the TabControl.Selecting event to tabControl1_Selecting
    4. Attach the TabControl.DrawItem event to tabControl1_DrawItem
    5. Then copy the following code into your form (you will have to change it a little)


      public Form1()
      {
       InitializeComponent();

       tabPage2.Enabled = false;

      }
      private void tabControl1_Selecting(object sender, TabControlCancelEventArgs e)
      {
       if (!e.TabPage.Enabled)
       {
        e.Cancel = true;
       }
      }

      private void tabControl1_DrawItem(object sender, DrawItemEventArgs e)
      {
       TabPage page = tabControl1.TabPages[e.Index];

       if (!page.Enabled)
       {
        using (SolidBrush brush = new SolidBrush(SystemColors.GrayText))
        {
         e.Graphics.DrawString(page.Text, page.Font, brush, e.Bounds);
        }
       }
       else
       {
        using (SolidBrush brush = new SolidBrush(page.ForeColor))
        {
         e.Graphics.DrawString(page.Text, page.Font, brush, e.Bounds);
        }
       }
      }


     



    Basically what you are doing is drawing your own tabs. You are disabling the TabPage in your constructor - be aware that the TabPage.Enabled is not visible in the designer or intellisense - but it does exist.

    Then in the selecting event you are stopping the focus from changing to a disabled page. In the DrawItem you are drawing the tabs yourself, so that you can mimic the disabled tab.

    This is not a complete solution, but it will get you started.

    HTH

    David

    Wednesday, May 25, 2005 11:13 AM
    Moderator
  • I entered the statement me.Me.TabPage5.Enabled = False.  It compiled OK, but didn't stop me from clicking it open.

    I also tried in form load the following two statements.

    Me.TabPage5.CanSelect = False
    complains CanSelect is ReadOnly

    OK, it is readonly in runtime, but why can't I set it someplace in design time.

    Me.TabPage5.Hide = True
    Complains Me.TabPage5.Hide is a Value therefore cannot be target of an assignment

    If me.TabPage5.Hide is a value, why isn't me.TabPage5.Enabled, CanSelect or any other property not a value.

    The selecting documentation is vacuous, and doesn't exist in vs studio 2003.  Furthermore, the selectedindexchanged documentation in both the vs 2005 and vs 2003 is of little help. 

    I have no clue how to stop a tab from being clicked or hiding it. This is a real shortcoming in the control and the documentation.

    dennist

    Saturday, May 28, 2005 2:50 PM
  • It's not a shortcoming of the control as its actually by design. A disabled tab page can be confusing to a user.

    Anyway, did you actually try using the code I post above?

    Setting TabPage5.Enabled = false, is not enough, you also need to do the things that I posted above.
    Saturday, May 28, 2005 8:19 PM
    Moderator
  • You guys are making things complicate.
    Just call the tab page's parent control and ask it remove the tab page when you want to hide it and add it when you show it again.
    Wednesday, June 08, 2005 10:43 PM
  • No we are not making things complicated. Hide and unhide is not an option, the users should be able to see the disabled tabs for navigation purposes.

    Microsoft is claiming that this control is working as designed and if you dive a little more down to their arguments see bugs/features they can simply not understand the use for this enable/disable tabs on a tab control and they are not encouraging any communication about this in order to better understand their customers.

    Several have asked for this feature all the way back from when MS first introduced the tab control. And if you are developing real live applications and using the tab control for more than configuration panels you will need this feature to disable and enable one or more tabs on a tab control.

    Right now the only alternative to this is buying a whole control package from a third party vendor, however I feel stupid when doing so just for this single feature/control.

    /Morten
     
    Thursday, June 09, 2005 7:23 AM
  • I need this functionality as well and it was never confusing to my clients under VB6 and they worked fine there.  The properties "enabled" and "visible" were always available under VS 2002/2003 and just never seemed to work.  If this is by design, then why do the properties "enabled" and "visible" still exist and help pages show how to use them (see any of the object references and there is MS-sponsored code showing how to "disable a tab page in code").  Both of these MS references supposedly show you how to do this in code:

    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/vbtskchangingappearanceofwindowsformstabcontrol.asp
    and
    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/vbtskdisablingtabpagesprogrammatically.asp

    Come on MS, either remove all references to these properties or implement them.  The only thing confusing with this issue is MS inconsistency in implementing the properties and the continued help references to them.

    Friday, December 16, 2005 5:23 AM
  • I think the gymnastics I'd have to go through to 'mimic' disabling a tab page are ridiculous.

    All third party tab controls make this as easy as in vb6.  Obviously there's widespread desire for the ability.

    Microsoft's attitude is elitist.  You snobs may not see a need for it, but we lowly everyday programmers and our clients need them.

    Now I'm forced to put out good money for third party controls.  I've have to buy a subscription so I can update them as vs studio or the net framework is updated.

    It's similar with asp.net 2.0.  It's a hassle with styles and formatting to get detailsview or any other databound server control to have a sharp look to them. Why aren't they as sharp as winform controls, without any contortions?  Third party asp.net controls are sharp without configuring styles and formatting.  You snobs are forcing us to put out an extra $1,000 a year for r.a.d, componentone, or infragistics.

    Given the big bucks we already have to pay for production versions of vs studio 2005, I think you're ripping us off.

    dennist685

    Friday, December 16, 2005 6:10 AM
  • Why would Microsoft allow a feature (such as disabling a TabControl) that goes against their own user interface design guidelines?

    Disabling a tab page is not intuitive. If I saw a disabled tab page (besides swearing at the designer of the dialog), I would wonder 1. why it was disabled, and 2. how could I get it enabled. Disabling a tab page is a sign of bad user interface design.

    The reason these properties exist is because they inherit them from Control. In both .NET 1.1 and .NET 2.0 these properties are hidden in the designer.

    Friday, December 16, 2005 6:38 AM
    Moderator
  • David, you said,

    Disabling a tab page is not intuitive. If I saw a disabled tab page (besides swearing at the designer of the dialog), I would wonder 1. why it was disabled, and 2. how could I get it enabled. Disabling a tab page is a sign of bad user interface design.

    My users never were confused.  And all the users of the third party tab controls, including asp.net 2.0 tab controls think their users won't be confused.

    I give visual clues, or simply tell the user when to click the next tab control in a label.

    Nobody has ever complained or been confused.  Obviously the millions of users of vb6 applications weren't confused either.

    It's still a rip-off. It's too late in my career to switch to Java.  I don't like the language anyway.  I love visual basic.  I like programming but love my applications, which is I am a visual basic programmer.

    You snobs are interested in some abstract purity. But I'm a down to earth engineer. Visual basic was designed for people like me. We know much better than you what makes average users confused, and know what visual clues they need to avoid confusion.

    I produce small scale applications and actually speak to many of the people who use them, even those who use them on the web.

     

    dennist685

    dennist685

    dennist685

    Friday, December 16, 2005 6:54 AM
  • > You snobs are interested in some abstract purity. But I'm a down to earth engineer. Visual basic was designed for people like me. We know much better than you what makes average users confused, and know what visual clues they need to avoid confusion.

    You have made the assumption that you know better than us 'snobs', yet you have no idea of my background. I doubt you spend the millions of dollars a year Microsoft does on usability tests (yes with 'real' users) that test this kind of thing but then again that would be an assumption - maybe you do.

    Anyway this topic is getting way off track. I provided a solution above, so I don't actually what the problem is unless you need to be converted to Visual Basic.

    Friday, December 16, 2005 7:06 AM
    Moderator
  • David,

    I apologize.

    But I will buy a third party subscription.

    dennist685

    Friday, December 16, 2005 8:21 AM
  • No need to buy anything. TabControlEX supports this feature and it's free.

    http://www.dotnetrix.co.uk/controls.html

     

    Friday, December 16, 2005 5:50 PM
  • Thank you Mick,

    But I'll still buy a subscription, if only for the asp.net controls, that look like real controls without having to mess with styles and formatting.

    dennist685

    Saturday, December 17, 2005 6:18 AM
  • Maybe you could remove the tab altogether from the TabControl and add it later when it's needed.

    Just an idea.

    Luis Alonso Ramos

    Sunday, December 18, 2005 4:38 AM
  • Thanks, Luis.

    But that is counterintuitive to users.  They like seeing the tab at all times. With the proper visual clues they know how to enable it, and why its disabled until the how is fulfilled.

    dennist685

    Sunday, December 18, 2005 6:25 AM
  • I don't know where you talking from. I have been designing software for the last 20 yeras, since DBase 3+ days and I think flexibility is good and I think there is need for it. I have found solution excedently. I have one control that serve as option file replacement, so advance that I had to split options into 3 TabPage. Now when moving/copying, all tabpages options is available, but when renaming a file and a file with the same name exist, I need only 1st tabpage that has Yes and No options.

    I would imagine there will be many setuation where you would need a standard set of options and enabling/disabling as required from different threads.

     

    So please don't wast peoples time, and stay a way if you don't have a solution.

     

    My solution:

    TabPage1.Enabled = False

    TabPage1.Enabled = True

    I had each line in a button and works works for me. The tabpage is visible, selectable but all controls on it is disabled.

    Tuesday, March 28, 2006 1:50 PM
  • Hello All,

     

    As amusing as this discussion has been, I think I would like to throw my two cents in.  I find it interesting that Microsoft would hide/remove from intelisense and functionality the enable / locked features that are available in all other controls.  They were features that were available in PRE-.NET era languages.

     

    For those of you who say someone is "wrong" for wanting a disabled tab...all I can say is...Have you seen EVERY application ever built...are you sure it is not appropriate in some circumstances...and if your answer is "NO" then...why are so many third party controls providing this functionality?

     

    If I may give a quick example.  I have a data intensive application, when a new case is opened, only the first tab is
    "Enabled" (traditional sense of the word...other tabs are greyed out).  Once the intial case information is entered and saved, depending on what sections are filled out...Other tabs become available.  The users LOVE this feature.  as it directs them to what additonal information is appropriate for the situation.

     

    Currently for the TabPage1.Enabled=false solution...the tab itself is selectable, but all content is GREYED out.  I submit for your consideration, that this is much less intuative than graying out the tab itself.  Currently the .ENABLED property seems to function along the paradigm of .LOCKED.

     

    I believe my comments may have strayed over the two cent marker...and approach $0.05. anyone have change?

    Tuesday, November 13, 2007 3:45 PM
  • I agree with you Dan and there are always ways to add such functionality but the problem is that it is not intuitive. If you inherit the Tab Control you can add this functionality, but those that are not familiar with the backstage code running on the control won't be able to do it, and Microsoft won't help you either.

    It is a pity, but like when I posted some functionality for the Tab Control (Ability to change Tab Color), you have to do it yourself.

    Tuesday, November 13, 2007 4:14 PM
  • Hi,

     

    I have been using the following TabControl which can be disabled for a while and it works like a charme.

    It comes with propper instructions as well.

     

    http://www.softwarebrigade.com/projects/CSharp/tools/instructions.php

     

    There is also a custom calendar control.

     

    Aussie
    Wednesday, February 27, 2008 2:56 AM
  • David I appreciate your time as a moderator and the code sample. 

     

    Then lack of enable/disable is a shortcoming of the design.   Fix the design!   Even if you don't agree with that we need a enable = false then let us write the poorly designed applicaitons our users are asking for.

     

    If enable / disable confuses users then why is that availble to many of the controls. 

     

    I wish the tab control also had  a visable = true / false. 

     

    Sometime you want to hide a control and some times disable.

     

    Let me provide a non programming example.   If I am on I 10 in and I 45 North to Dallas is closed (disabled) I want a sign "I 45 North Closed".   With your design logic a "closed" sign would only confuse the user.   Do you really think that knowing a road is closed is informaiton the driver does not want?

     

    Did you hear the joke about how many Microsft develors does it take to change a light buld?   None they just change the standard to darkness.  

    Thursday, May 22, 2008 1:12 AM
  • After spending HOURS researching this I only have 1 thing to say...

     

    It is ABSURD that Microsoft, and it's employees and affiliates (especially the ones posting to this thread - you know who you are), seriosuly consider it bad UI design regarding disabling tabs. That is either pure ignorance, or pure stupidity.

     

    And to have to go through some jerry-rigged inheritance and custom code just to implement a tabpage enable, WTF.

     

    I needed this functionality for my app, to disable tabs, and I sure as *** won't buy any 3rd party controls for this purpose, so here is my solution to the problem:

     

    My screnario:

    I have 5 different tab pages. When a user edits fields on tab 1, i need to prevent them from being able to go to the other tabs.

     

    Dream Solution: Disable the other tabs. But cant do that, because apparently thats bad UI design. rofl. More like bad control design if you ask me.

     

    My solution:

    I have a form level variable that gets assigned the currently selected tab when the user clicks the shared EDIT button. The edit button also goes disabled on click.

     

    In the tabs selectedindexchanged event I put the following:

     

        Private Sub tabMain_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles tabMain.SelectedIndexChanged
            If cmdEdit.Enabled = False Then
                If tabMain.SelectedIndex <> m_iCurrTab Then
                    MessageBox.Show("Please save your changes before navigating to another tab.", "Editing Record", MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
                End If
                tabMain.SelectedIndex = m_iCurrTab
            End If
        End Sub

     

    So even though the tabs are not disabled, it sends the user back to the calling tab.

     

    Hope that helps.

     

    Friday, August 08, 2008 1:06 AM
  • TabControlEx not only allows Disabled Tabs, but it is also Free.

     

    http://dotnetrix.co.uk/controls.html

     

    On this page you will also find a second tabcontrol which is written for Framework 2.0. This is also free, but it doesn't offer all the features of TabControlEx. If, however, you only want disabled tabs, then this one should be much better.

    Friday, August 08, 2008 3:17 PM
  • Hi.

     

    I too had this problem as I wanted tabs to be enabled in a controlled sequential way.

     

    Looks like this issue has been resolved in Visual Basic 2008.

     

    The Tab control now has a SELECTING event which fires BEFORE the tab is changed - enabling you to Cancel the change if necessary. See the following article :

     

    http://msdn.microsoft.com/en-us/library/system.windows.forms.tabcontrol.selecting.aspx

     

    Just tried it and it works like a treat!
    Tuesday, August 19, 2008 3:39 PM
  •  

    I had the same problem and I never found an answer to this issue, playing around with vs I found the solution, please follow the link and take a look at the bottom of the page where I posted how to solve it:

    http://msdn.microsoft.com/en-us/library/252t3cec.aspx

     

    Greetings !!!

    Sunday, November 23, 2008 9:18 AM
  • chnage InitializeComponent() to InitializeComponent(int TabNumber) forexample you have 4 tabpages add this line into InitializeComponent(int TabIndex): if (TabNumber < 4 && TabNumber >= 0) { object[] TabPages = { this.page1, this.page2, this.page3, this.page4 }; for (int i = 0; i < TabNumber; ++i) { this.tabControl.Controls.Add((System.Windows.Forms.Control)TabPages[i]); } } else { this.tabControl.Controls.Add(this.page1); this.tabControl.Controls.Add(this.page2); this.tabControl.Controls.Add(this.page3); this.tabControl.Controls.Add(this.page4); } ... then in your form constructor pass the number that you want to be in tabcontrol
    Monday, June 08, 2009 8:51 AM
  • Perfect. Thank you.

    Friday, July 24, 2009 1:22 PM
  •  

    Hi guys, this is my solution:

    private
    void tabControl1_SelectedIndexChanged(object sender, EventArgs e)

    {

     

    if (<logical_condition>){tabControl1.SelectedIndex = 0;}

    }

    Tuesday, November 10, 2009 6:06 PM
  • 1. I tried David's solution and it runs perfectly as is, but it does not work as desired when TabPage.Enabled property is switched interactively.
    When TabPage1.Enabled set to True, TabPage1 is expected to turn enabled (black TabPage text).
    When TabPage1.Enabled set to False, TabPage1 is expected to turn disabled (grey TabPage text).

    2. Is there also a solution for TabControl.DrawMode = TabDrawMode.Normal instead of OwnerDrawFixed?

    Ingmar

    Monday, December 14, 2009 1:20 PM
  • Ingmar
    I've just found this thread and implemented David's solution with the same reservation as you mention.
    But if you call tabControl.Refresh(); immediately after you enable/disable the tab page, this forces a call to DrawItem and sets the tab text to black/grey as appropriate.
    As far as I can see, this now perfectly replicates the behaviour one would expect from tabPage.Enable=false;
    It does seem eccentric of MS not to implement this feature properly, but at least this provides an acceptable workround without going to the trouble of getting 3rd-party controls.
    Jason
    Friday, January 08, 2010 1:37 PM
  • Hi Jason,

    I've found that problem here, the app must show a tabPage with Login and before it is sucessfull all the other tabs must be available.

    My solution where to get the tab in a variable and remove the tab at _Onload, then if the login occurred sucessfully the app show the other tabs.

    like this:

    //declare the variable (attention to the scope)

    TabPage

     

    tab1;

    private

     

    void StartUp_Load(object sender, EventArgs e)

    {

    //put the tab inside the variable//

                 tab1 = tabPage1;

    //remove the tab (it is now inside the var)

                 this.tabControl1.TabPages.Remove(tabPage1);

    }

    private void button8_Click(object sender, EventArgs e)

    {

    //add the tabPage again//

     

    this.tabControl1.TabPages.Add(tab1);

    }

     

    I dont'know if it is the most elegant way to do, but is the only one that works.

    regards,

    Sidney Bezerra
    Web Consultant
    AVIS Rent-a-Car

     

     

    Friday, August 27, 2010 1:16 PM
  • instead of disabling the tab page

    1. change the forecolor of the tab.

    2.put all the controls on that page in a panel, or something, and disable the panel

    3. have  a label that gets turned on or off that explains why the tab is disabled

    user can still click on tab, but wont be able to do anything.
    I use the tabs like a wizard, and if you dont do step 1, you cant do step 2.

    it would be nice if the functionality was there, but either work around it or use a different tool.

    Saturday, December 25, 2010 4:56 PM
  • Hi guys,

     

    Very Happy New Year...

     

     

    This is a way to make the TabPage Enable/Disable,, no need to go for thirty party controls...

     

    TabPage also inherit the control properties..

     

    Control tab = new Control;
    
    tab = TabPage1; //your tabpage name
    
    tab.Enable = False;
    

     

    I'm new to this forum, apologize if anything wrong..

     

    Good luck!

    Tuesday, January 04, 2011 2:05 PM
  • Pragashan, Thank you very much, that fixed the problem completely!
    Tuesday, July 19, 2011 3:50 PM
  • Thanks a lot mate! That really helped! Clever solution :)
    Wednesday, September 21, 2011 10:58 PM
  • Thanks much to Dave. Search for this topic and you will find lots of solutions. Here is one I crafted from the submissions of many others (Dave (here), Debasmit Samal, Vytas999, Web Star, Binny ch, etc.). Using TextRenderer solves some display issues.

    Somewhere in your logic set state of tabs as desired:

     

    myTabPage.Enabled = false;

     

    Then set the drawing mode of the entire TabControl so you can catch the DrawItem event:

     

    myTabControl.DrawMode = TabDrawMode.OwnerDrawFixed; 

     


    Then add these:

            private void ideaTabControl_Selecting(object sender, TabControlCancelEventArgs e)
            {
                if (!e.TabPage.Enabled)
                {
                    MessageBox.Show("<Inform user as to why the tab is disabled>");
                    e.Cancel = true;
                }
            }
    
            private void ideaTabControl_DrawItem(object sender, DrawItemEventArgs e)
            {
                TabPage tabPage = ideaTabControl.TabPages[e.Index];
                Color foreColor = SystemColors.WindowText;
                if (tabPage.Enabled == false) foreColor = SystemColors.GrayText;
                Rectangle tabRectangle = ideaTabControl.GetTabRect(e.Index);
                TextRenderer.DrawText(e.Graphics, tabPage.Text, this.ideaTabControl.Font, tabRectangle, foreColor);
            }



    • Edited by Quickdraw Thursday, December 22, 2011 6:29 AM
    Thursday, December 22, 2011 6:27 AM
  • No need for third party controls or complex code - just

    tabMain.TabPages(1).Enabled =False

    where tabMain is the name of the Tab Control.  Easy..


    • Edited by sc0tsman Wednesday, January 18, 2012 8:25 AM
    Wednesday, January 18, 2012 8:24 AM
  • TRY THIS ..........
    public partial class Form1 : Form
        {
            public Form1()
            {
                InitializeComponent();
            }
    
            private void cmb_SelectedIndexChanged(object sender, EventArgs e)
            {
                HandleTabPage();
            }
    
            private void Form1_Load(object sender, EventArgs e)
            {
                cmb.SelectedIndex = 0;
                HandleTabPage();
            }
    
            void HandleTabPage()
            {
                tc.TabPages.Clear();
                //
                tc.TabPages.Add(tp1);
                tc.TabPages.Add(tp2);
                tc.TabPages.Add(tp3);
    
                TabPage temp = tc.TabPages[cmb.SelectedIndex];
                //
                tc.TabPages.Clear();
    
                tc.TabPages.Add(temp);
            }
            
        }

    Friday, June 01, 2012 12:49 PM
  • Thanks much to Dave. Search for this topic and you will find lots of solutions. Here is one I crafted from the submissions of many others (Dave (here), Debasmit Samal, Vytas999, Web Star, Binny ch, etc.). Using TextRenderer solves some display issues.

    Somewhere in your logic set state of tabs as desired:

            private void ideaTabControl_Selecting(object sender, TabControlCancelEventArgs e)
            {
                if (!e.TabPage.Enabled)
                {
                    MessageBox.Show("<Inform user as to why the tab is disabled>");
                    e.Cancel = true;
                }
            }
    
            private void ideaTabControl_DrawItem(object sender, DrawItemEventArgs e)
            {
                TabPage tabPage = ideaTabControl.TabPages[e.Index];
                Color foreColor = SystemColors.WindowText;
                if (tabPage.Enabled == false) foreColor = SystemColors.GrayText;
                Rectangle tabRectangle = ideaTabControl.GetTabRect(e.Index);
                TextRenderer.DrawText(e.Graphics, tabPage.Text, this.ideaTabControl.Font, tabRectangle, foreColor);
            }
    



    Hi,

    The code snippet is helpful. Thanks for your contribution.

    Friday, September 28, 2012 7:14 AM
  • sample code for  this is 

    if ( !AdminLevel )
    {	
    	tabControl1.TabPages.Remove(tabPage3); 
    }


    rwg

    Tuesday, October 30, 2012 4:56 PM