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. C#
  4. Hidding a tab page

Hidding a tab page

Scheduled Pinned Locked Moved C#
comtoolsquestion
7 Posts 4 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.
  • P Offline
    P Offline
    Programm3r
    wrote on last edited by
    #1

    Hi all, I have read the documentation on MSDN regarding the tabpage control. It states that the tab page within the tabcontrol can not be hidden. According to the MSDN to hide it, one needs to remove it. This is quite hideous! Isn't there another way of doing it? Many thanks in advance Regards,


    The only programmers that are better that C programmers are those who code in 1's and 0's :bob: :)Programm3r My Blog: ^_^

    J N X 3 Replies Last reply
    0
    • P Programm3r

      Hi all, I have read the documentation on MSDN regarding the tabpage control. It states that the tab page within the tabcontrol can not be hidden. According to the MSDN to hide it, one needs to remove it. This is quite hideous! Isn't there another way of doing it? Many thanks in advance Regards,


      The only programmers that are better that C programmers are those who code in 1's and 0's :bob: :)Programm3r My Blog: ^_^

      J Offline
      J Offline
      JustChiragPatel
      wrote on last edited by
      #2

      hi, yes i have also faced this problem. we can not hide tab page in tab control. but i have find a solution by making one custom tab control which has "HideTabPage" property which allow me to hide tab page. but you can also disable all controls on that tabpage, if you don't want to allow users to use controls on that tab page. you ca use this code... For Each ctl As TabPage In myTabControl.TabPages If ctl.Name.Equals(tPageToRemove.Name) Then For Each ctlchild As Control In ctl.Controls ctlchild.Enabled = False Next End If Next by this code you can disable all controls on given tab page. Bye :-D .

      Chirag Patel Programmer Analyst India

      P 1 Reply Last reply
      0
      • J JustChiragPatel

        hi, yes i have also faced this problem. we can not hide tab page in tab control. but i have find a solution by making one custom tab control which has "HideTabPage" property which allow me to hide tab page. but you can also disable all controls on that tabpage, if you don't want to allow users to use controls on that tab page. you ca use this code... For Each ctl As TabPage In myTabControl.TabPages If ctl.Name.Equals(tPageToRemove.Name) Then For Each ctlchild As Control In ctl.Controls ctlchild.Enabled = False Next End If Next by this code you can disable all controls on given tab page. Bye :-D .

        Chirag Patel Programmer Analyst India

        P Offline
        P Offline
        Programm3r
        wrote on last edited by
        #3

        Hi, Chirag, Thanks for the reply. Regarding your comment:

        JustChiragPatel wrote:

        but i have find a solution by making one custom tab control which has "HideTabPage" property which allow me to hide tab page.

        Could you perhaps give an example of this? Cause disabling all of the components on the tabpage is not what I'm trying to do. Many thanks in advance Regards,


        The only programmers that are better that C programmers are those who code in 1's and 0's :bob: :)Programm3r My Blog: ^_^

        J 1 Reply Last reply
        0
        • P Programm3r

          Hi, Chirag, Thanks for the reply. Regarding your comment:

          JustChiragPatel wrote:

          but i have find a solution by making one custom tab control which has "HideTabPage" property which allow me to hide tab page.

          Could you perhaps give an example of this? Cause disabling all of the components on the tabpage is not what I'm trying to do. Many thanks in advance Regards,


          The only programmers that are better that C programmers are those who code in 1's and 0's :bob: :)Programm3r My Blog: ^_^

          J Offline
          J Offline
          JustChiragPatel
          wrote on last edited by
          #4

          hi, ok, i think building custom tab control will solve your problem. i can give you logic for custom control. logic of "HideTabPage" method is, take array of tabpages control which are in custome tabcontrol. and remove that tabpage from tabcontrol which you want to hide. and when you want to show/display that removed tabpage then add taht tab page from tabpages array into tabpage control. you can also modify this logic according to your requirement. you can make some browseable properties also, so you can hide/show tabpages by setting property values. Bye :-D.

          Chirag Patel Programmer Analyst India

          1 Reply Last reply
          0
          • P Programm3r

            Hi all, I have read the documentation on MSDN regarding the tabpage control. It states that the tab page within the tabcontrol can not be hidden. According to the MSDN to hide it, one needs to remove it. This is quite hideous! Isn't there another way of doing it? Many thanks in advance Regards,


            The only programmers that are better that C programmers are those who code in 1's and 0's :bob: :)Programm3r My Blog: ^_^

            N Offline
            N Offline
            N a v a n e e t h
            wrote on last edited by
            #5

            Programm3r wrote:

            This is quite hideous!

            I don't think so. Tab control is built for showing multiple tabs. Why you need to hide one tab page ? Are you looking for wizard kind of stuff ? Alternatively you can disable the controls in one tab page by casting the tab page into control and setting Enabled=false.

            All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia How to use google | Ask smart questions

            P 1 Reply Last reply
            0
            • N N a v a n e e t h

              Programm3r wrote:

              This is quite hideous!

              I don't think so. Tab control is built for showing multiple tabs. Why you need to hide one tab page ? Are you looking for wizard kind of stuff ? Alternatively you can disable the controls in one tab page by casting the tab page into control and setting Enabled=false.

              All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia How to use google | Ask smart questions

              P Offline
              P Offline
              Programm3r
              wrote on last edited by
              #6

              Thank you for the reply and information Regards,


              The only programmers that are better that C programmers are those who code in 1's and 0's :bob: :)Programm3r My Blog: ^_^

              1 Reply Last reply
              0
              • P Programm3r

                Hi all, I have read the documentation on MSDN regarding the tabpage control. It states that the tab page within the tabcontrol can not be hidden. According to the MSDN to hide it, one needs to remove it. This is quite hideous! Isn't there another way of doing it? Many thanks in advance Regards,


                The only programmers that are better that C programmers are those who code in 1's and 0's :bob: :)Programm3r My Blog: ^_^

                X Offline
                X Offline
                Xmen Real
                wrote on last edited by
                #7

                i have developed a program where a close button on every tabpage, i used Control.Remove() to remove tabpage from tabcontrol when close button is pressed, and add that tabpage when user want to add, so i dont think its hideous

                TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L %^]*IRXD#@GKCQ`R\^SF_WcHbORY87??6?N8?BcRAV\Z^&SU~%CSWQ@#2 W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN% Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-i?TV.C\y -------------------------------------------------------- 128 bit encrypted signature, crack if you can

                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