Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. How to disable TabPage of TabControl

How to disable TabPage of TabControl

Scheduled Pinned Locked Moved Visual Basic
helptutorial
7 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Sumit Prakash Sharma
    wrote on last edited by
    #1

    In my application there are 3 tab pages my problem is when i open my application 3rd tab pages should be open and other 1st and 2nd tab page should be disabled. if i click on enable tab pages then both 1st and 2nd tab page will be enable and 3rd tab page should be disable i have tried tabpage.hide property of tab page but it is not work

    N L 2 Replies Last reply
    0
    • S Sumit Prakash Sharma

      In my application there are 3 tab pages my problem is when i open my application 3rd tab pages should be open and other 1st and 2nd tab page should be disabled. if i click on enable tab pages then both 1st and 2nd tab page will be enable and 3rd tab page should be disable i have tried tabpage.hide property of tab page but it is not work

      N Offline
      N Offline
      Nilesh Hapse
      wrote on last edited by
      #2

      Check if this helps: http://msdn.microsoft.com/en-us/library/252t3cec.aspx[^]

      "Legacy code" often differs from its suggested alternative by actually working and scaling. —Bjarne Stroustrup

      S 1 Reply Last reply
      0
      • S Sumit Prakash Sharma

        In my application there are 3 tab pages my problem is when i open my application 3rd tab pages should be open and other 1st and 2nd tab page should be disabled. if i click on enable tab pages then both 1st and 2nd tab page will be enable and 3rd tab page should be disable i have tried tabpage.hide property of tab page but it is not work

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        A TabControl stores it's pages in a [TabPageCollection](http://msdn.microsoft.com/en-us/library/system.windows.forms.tabcontrol.tabpagecollection_methods.aspx)[[^](http://msdn.microsoft.com/en-us/library/system.windows.forms.tabcontrol.tabpagecollection_methods.aspx "New Window")]. You can add or remove pages from this collection. Hope this helps :)

        I are troll :)

        S 1 Reply Last reply
        0
        • L Lost User

          A TabControl stores it's pages in a [TabPageCollection](http://msdn.microsoft.com/en-us/library/system.windows.forms.tabcontrol.tabpagecollection_methods.aspx)[[^](http://msdn.microsoft.com/en-us/library/system.windows.forms.tabcontrol.tabpagecollection_methods.aspx "New Window")]. You can add or remove pages from this collection. Hope this helps :)

          I are troll :)

          S Offline
          S Offline
          Sumit Prakash Sharma
          wrote on last edited by
          #4

          my question is not about how to add or remove tab pages, but i want to enable - disable some tab page by programming

          L 1 Reply Last reply
          0
          • N Nilesh Hapse

            Check if this helps: http://msdn.microsoft.com/en-us/library/252t3cec.aspx[^]

            "Legacy code" often differs from its suggested alternative by actually working and scaling. —Bjarne Stroustrup

            S Offline
            S Offline
            Sumit Prakash Sharma
            wrote on last edited by
            #5

            Thanks for answer its too informatic and good

            1 Reply Last reply
            0
            • S Sumit Prakash Sharma

              my question is not about how to add or remove tab pages, but i want to enable - disable some tab page by programming

              L Offline
              L Offline
              Lost User
              wrote on last edited by
              #6

              I'm sorry for wasting your time, but at the time it sounded like a viable alternative to me :)

              I are troll :)

              S 1 Reply Last reply
              0
              • L Lost User

                I'm sorry for wasting your time, but at the time it sounded like a viable alternative to me :)

                I are troll :)

                S Offline
                S Offline
                Sumit Prakash Sharma
                wrote on last edited by
                #7

                Its Ok Dear As there is no any "Enabled" property of tab page so we have to check it is in tabcontrol's "SelectedIndexChanged" event like the following code Private Sub tabCon_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles tabCon.SelectedIndexChanged If YourCondition Then Me.tabCon.SelectedIndex = 1 End If End Sub to set defualt TabPage write the following code in form load event Me.tabCon.SelectedIndex = 1 'Here 1 is the index of desired tabpage

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups