CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5

Thread: TabControl

  1. #1
    Join Date
    Nov 2001
    Posts
    28

    TabControl

    Hello everyone

    the Tabcontrol in .Net is not very adequate. I can't disable only one tab or I can't hide only one tab. Do you know a better tabControl?

    Thank you

  2. #2
    Join Date
    May 2002
    Location
    Perth
    Posts
    28
    This disable's a tab page, is that what you want?, it works for me.

    Code:
           'disable this page
            Me.TabPage3.Enabled = False
    EDIT:
    I think i may have mis-read your post, you want to disable the tab itself, i think the above disable's any controls on the tabpage.
    I'm not sure how to disable or hide a tab.
    Last edited by CC_; December 5th, 2002 at 08:55 PM.

  3. #3
    Join Date
    Oct 2002
    Posts
    34
    I found this in VS help:

    Use the Add method of the TabPages property.
    ' Visual Basic
    Dim myTabPage As New TabPage()
    myTabPage.Text = "TabPage" & (TabControl1.TabPages.Count + 2)
    TabControl1.TabPages.Add(myTabPage)

    Use the Remove method of the TabPages property to remove selected tabs; or to remove all tabs, use the Clear method of the TabPages property.
    ' Visual Basic
    ' Removes the selected tab:
    TabControl1.TabPages.Remove(TabControl1.SelectedTab)
    ' Removes all the tabs:
    TabControl1.TabPages.Clear()
    Have a nice day! (^_^)

  4. #4
    Join Date
    Nov 2001
    Posts
    28
    allright

    but this will destroy the tab and all is controls. What I want is, I have two radio button, when radio button 1 is selected, the tab 3 isn't visible. If the radio button 2 is selected, the tab 3 is visible. The user can change the radio button selection so the tab must be hide and unhide and hide and unhide. If I remove the tab, I will remove all the controls. I don't want to create all the controls dynamicly each time

    any solution?

    Thank you

  5. #5
    Join Date
    Oct 2002
    Posts
    34
    http://msdn.microsoft.com/msdnmag/is...s/default.aspx

    This article discusses a problem similar to yours. Maybe you can get some insight from it.

    Hope it helps.
    Have a nice day! (^_^)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured