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. Windows Forms
  4. Control hide/show(should be post here, right?)

Control hide/show(should be post here, right?)

Scheduled Pinned Locked Moved Windows Forms
question
7 Posts 2 Posters 5 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.
  • K Offline
    K Offline
    kenmaMoon
    wrote on last edited by
    #1

    I'm creating an user control like treeView, in this control, I want to put a button to let my user control hide/show in Owner form. how could I do? thanks

    L 2 Replies Last reply
    0
    • K kenmaMoon

      I'm creating an user control like treeView, in this control, I want to put a button to let my user control hide/show in Owner form. how could I do? thanks

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

      You already posted this question at http://www.codeproject.com/Messages/4548577/Control-hide-show.aspx[^]. Please choose one forum only and stick to it.

      Use the best guess

      K 1 Reply Last reply
      0
      • L Lost User

        You already posted this question at http://www.codeproject.com/Messages/4548577/Control-hide-show.aspx[^]. Please choose one forum only and stick to it.

        Use the best guess

        K Offline
        K Offline
        kenmaMoon
        wrote on last edited by
        #3

        Just delete it in C# forum

        L 1 Reply Last reply
        0
        • K kenmaMoon

          Just delete it in C# forum

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

          I don't have authority to do that; but it's important that you read and follow http://www.codeproject.com/Messages/3137519/Forum-Guidelines-PLEASE-READ.aspx[^].

          Use the best guess

          1 Reply Last reply
          0
          • K kenmaMoon

            I'm creating an user control like treeView, in this control, I want to put a button to let my user control hide/show in Owner form. how could I do? thanks

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

            kenmaMoon wrote:

            how could I do?

            Toggle the Visible property? The problem is a logical one; if you hide the control containing the button to toggle visibility, the user will not be able to make it visible again, as the button that toggles it is invisible too.

            Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^]

            K 1 Reply Last reply
            0
            • L Lost User

              kenmaMoon wrote:

              how could I do?

              Toggle the Visible property? The problem is a logical one; if you hide the control containing the button to toggle visibility, the user will not be able to make it visible again, as the button that toggles it is invisible too.

              Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^]

              K Offline
              K Offline
              kenmaMoon
              wrote on last edited by
              #6

              thanks for your reply. yes, but the button is in the userControl, next time I want the user control shown by click the button.

              L 1 Reply Last reply
              0
              • K kenmaMoon

                thanks for your reply. yes, but the button is in the userControl, next time I want the user control shown by click the button.

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

                kenmaMoon wrote:

                yes, but the button is in the userControl, next time I want the user control shown by click the button.

                Re-read what I wrote; the button will be invisible if you hide the container it's in. You cannot click an invisible button. Either put the button somewhere else and have it toggle the Visible property, or put the button somewhere on location (0,0) and resize the control to shrink to the size of the button. Third, best option; throw the button and the control you wish to show/hide on a new usercontrol.

                Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^]

                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