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. Help Regarding panel.Hide

Help Regarding panel.Hide

Scheduled Pinned Locked Moved C#
questiongraphicsjsonhelp
9 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.
  • T Offline
    T Offline
    tasumisra
    wrote on last edited by
    #1

    Hi all, I have alomost 20 pannels but on the form load i have to dispay upto 3, depending on the parameter, so here what am trying to do ... i am creating a form having all the pannels and during runtime on form load am hiding rest of the pannel apart from which one need to show, but its dosent looks good coz of space.. so my question is 1.How can i remove the space i tried with panel1.Size=new system.Drawing(200,300) but not able to locate properly.. 2.can it be done by anyother ways ? Thank you very much

    vikas da

    S J 2 Replies Last reply
    0
    • T tasumisra

      Hi all, I have alomost 20 pannels but on the form load i have to dispay upto 3, depending on the parameter, so here what am trying to do ... i am creating a form having all the pannels and during runtime on form load am hiding rest of the pannel apart from which one need to show, but its dosent looks good coz of space.. so my question is 1.How can i remove the space i tried with panel1.Size=new system.Drawing(200,300) but not able to locate properly.. 2.can it be done by anyother ways ? Thank you very much

      vikas da

      S Offline
      S Offline
      Super Lloyd
      wrote on last edited by
      #2

      > 1.but not able to locate properly Control.Location, Control.Size and Control.Bounds are your friends... >2.can it be done by anyother ways hu.. what kind of way?

      A train station is where the train stops. A bus station is where the bus stops. On my desk, I have a work station.... _________________________________________________________ My programs never have bugs, they just develop random features.

      T 1 Reply Last reply
      0
      • S Super Lloyd

        > 1.but not able to locate properly Control.Location, Control.Size and Control.Bounds are your friends... >2.can it be done by anyother ways hu.. what kind of way?

        A train station is where the train stops. A bus station is where the bus stops. On my desk, I have a work station.... _________________________________________________________ My programs never have bugs, they just develop random features.

        T Offline
        T Offline
        tasumisra
        wrote on last edited by
        #3

        Super Lloyd wrote:

        hu.. what kind of way?

        like if we have no of pannels somewhere else .. since we are knowing the names of all the pannels so at run time if can add the required pannel .. am asking coz if i am saying pannel.hide or setting its visibility as false it will still use memory ...so why should we keep something that is not usefull ...so can you help me here .... Thank you very much for your reply :)

        vikas da

        S G 2 Replies Last reply
        0
        • T tasumisra

          Super Lloyd wrote:

          hu.. what kind of way?

          like if we have no of pannels somewhere else .. since we are knowing the names of all the pannels so at run time if can add the required pannel .. am asking coz if i am saying pannel.hide or setting its visibility as false it will still use memory ...so why should we keep something that is not usefull ...so can you help me here .... Thank you very much for your reply :)

          vikas da

          S Offline
          S Offline
          Super Lloyd
          wrote on last edited by
          #4

          I do suggest using Hide()/Show() instead of destroying/creating the panels. For some reason destroying/creating the panel takes a noticeable amount of time, and can really drag the application down if you have many of them. On the other hand your panels probably don't use that much memory and show()/hide() is quite fast. Anway, good luck!

          A train station is where the train stops. A bus station is where the bus stops. On my desk, I have a work station.... _________________________________________________________ My programs never have bugs, they just develop random features.

          T 1 Reply Last reply
          0
          • S Super Lloyd

            I do suggest using Hide()/Show() instead of destroying/creating the panels. For some reason destroying/creating the panel takes a noticeable amount of time, and can really drag the application down if you have many of them. On the other hand your panels probably don't use that much memory and show()/hide() is quite fast. Anway, good luck!

            A train station is where the train stops. A bus station is where the bus stops. On my desk, I have a work station.... _________________________________________________________ My programs never have bugs, they just develop random features.

            T Offline
            T Offline
            tasumisra
            wrote on last edited by
            #5

            oke thank you very much :)

            vikas da

            1 Reply Last reply
            0
            • T tasumisra

              Super Lloyd wrote:

              hu.. what kind of way?

              like if we have no of pannels somewhere else .. since we are knowing the names of all the pannels so at run time if can add the required pannel .. am asking coz if i am saying pannel.hide or setting its visibility as false it will still use memory ...so why should we keep something that is not usefull ...so can you help me here .... Thank you very much for your reply :)

              vikas da

              G Offline
              G Offline
              Guffa
              wrote on last edited by
              #6

              You can create panels at runtime and add to the form's Controls collection. That's what the code created by the form designer does.

              Despite everything, the person most likely to be fooling you next is yourself.

              T 1 Reply Last reply
              0
              • G Guffa

                You can create panels at runtime and add to the form's Controls collection. That's what the code created by the form designer does.

                Despite everything, the person most likely to be fooling you next is yourself.

                T Offline
                T Offline
                tasumisra
                wrote on last edited by
                #7

                Thank you very much Guffa ... but here i am failing in my knowledge ... can you please help me here ...with some sample code ... :) thank you very much ...

                vikas da

                1 Reply Last reply
                0
                • T tasumisra

                  Hi all, I have alomost 20 pannels but on the form load i have to dispay upto 3, depending on the parameter, so here what am trying to do ... i am creating a form having all the pannels and during runtime on form load am hiding rest of the pannel apart from which one need to show, but its dosent looks good coz of space.. so my question is 1.How can i remove the space i tried with panel1.Size=new system.Drawing(200,300) but not able to locate properly.. 2.can it be done by anyother ways ? Thank you very much

                  vikas da

                  J Offline
                  J Offline
                  jamesjk
                  wrote on last edited by
                  #8

                  Why dont you just dock the panels properly & then set the visible to true or false based on your parameter. If all the panels are docked properly setting the visibility will do the trick for you

                  T 1 Reply Last reply
                  0
                  • J jamesjk

                    Why dont you just dock the panels properly & then set the visible to true or false based on your parameter. If all the panels are docked properly setting the visibility will do the trick for you

                    T Offline
                    T Offline
                    tasumisra
                    wrote on last edited by
                    #9

                    wooow great idea it is working fine for a sample ...let me implement this into my code ..:) Thank you very much ....

                    vikas da

                    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