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. Hi all

Hi all

Scheduled Pinned Locked Moved C#
question
10 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

    I have a windows form of some size say (519, 118) now i have three pannels there somewhere in the center of the form.. now at run time i want to make some pannel invisible so how can i resize the form so that it form looks good ..means the space that was dedicated for pannel 1 is removed at run time :) Thank you ver much

    vikas da

    S R T 3 Replies Last reply
    0
    • T tasumisra

      I have a windows form of some size say (519, 118) now i have three pannels there somewhere in the center of the form.. now at run time i want to make some pannel invisible so how can i resize the form so that it form looks good ..means the space that was dedicated for pannel 1 is removed at run time :) Thank you ver much

      vikas da

      S Offline
      S Offline
      Syed Shahid Hussain
      wrote on last edited by
      #2

      your panel are in horizontal layout or verticle, what ever be change the logic accordingly set two properties Location and size First location Point (0,0) size(form.width,form.height/2) second location Point (0,form.height/2) size(form.width,form.height/2) That's it. (According to my perception) Be happy

      Syed Shahid Hussain

      T 1 Reply Last reply
      0
      • T tasumisra

        I have a windows form of some size say (519, 118) now i have three pannels there somewhere in the center of the form.. now at run time i want to make some pannel invisible so how can i resize the form so that it form looks good ..means the space that was dedicated for pannel 1 is removed at run time :) Thank you ver much

        vikas da

        R Offline
        R Offline
        Ravi Kumar Tyagi
        wrote on last edited by
        #3

        panel3.Visible = false; this.Size = new Size(this.Height - panel3.Height , this.Width); i am assuming all three panel are in vertically arranged and panel 3 is the last panel. or to make the load of the form as per available controls you can write the resize event of the form.

        T 1 Reply Last reply
        0
        • S Syed Shahid Hussain

          your panel are in horizontal layout or verticle, what ever be change the logic accordingly set two properties Location and size First location Point (0,0) size(form.width,form.height/2) second location Point (0,form.height/2) size(form.width,form.height/2) That's it. (According to my perception) Be happy

          Syed Shahid Hussain

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

          first of all sorry i was away from my system... it is not just a pannel on the form i am having grid and some button also... the pannels are just below the grid and above to buttons ... i was trying to dock the pannel but no luck coz it is neither top nor bottom or verticle .. thank you very much for ur help ... i am sorry i didnt clear all these points earlier ...

          vikas da

          1 Reply Last reply
          0
          • R Ravi Kumar Tyagi

            panel3.Visible = false; this.Size = new Size(this.Height - panel3.Height , this.Width); i am assuming all three panel are in vertically arranged and panel 3 is the last panel. or to make the load of the form as per available controls you can write the resize event of the form.

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

            Thank you very much for ur reply ... all pannels are horigental let me try with this solution .. i will do like panel3.Visible = false; this.Size = new Size(this.Height , this.Width- panel3.Width);

            vikas da

            1 Reply Last reply
            0
            • T tasumisra

              I have a windows form of some size say (519, 118) now i have three pannels there somewhere in the center of the form.. now at run time i want to make some pannel invisible so how can i resize the form so that it form looks good ..means the space that was dedicated for pannel 1 is removed at run time :) Thank you ver much

              vikas da

              T Offline
              T Offline
              Tuwing Sabado
              wrote on last edited by
              #6

              Hi, Instead of hiding and resizing the other panel use INHERITED FORM. This approach is better because it uses OOP when designing Windows forms. This concept is similar with MASTER PAGE of ASP.NET. Regards,

              T 1 Reply Last reply
              0
              • T Tuwing Sabado

                Hi, Instead of hiding and resizing the other panel use INHERITED FORM. This approach is better because it uses OOP when designing Windows forms. This concept is similar with MASTER PAGE of ASP.NET. Regards,

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

                can you please explain me bit more... from where i should inherit and what functionality(property) should be there so the resizing part can be done easily ...

                vikas da

                T 1 Reply Last reply
                0
                • T tasumisra

                  can you please explain me bit more... from where i should inherit and what functionality(property) should be there so the resizing part can be done easily ...

                  vikas da

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

                  .......................................................................
                  . .
                  . .
                  . .
                  . .
                  . .
                  . .
                  . .
                  . |--------------------------| .
                  . | pannel1 | .
                  . |--------------------------| .
                  . |--------------------------| .
                  . | pannel2 | .
                  . |--------------------------| .
                  . | pannel3 | .
                  . |--------------------------| .
                  . .
                  . .
                  . .
                  . .
                  .......................................................................

                  so in above if i am saying panel1.hide so panel2 and panel3 should be on the place of panel1 and panel2 respectively i want to solve this one .. please help me ...

                  vikas da

                  T 2 Replies Last reply
                  0
                  • T tasumisra

                    .......................................................................
                    . .
                    . .
                    . .
                    . .
                    . .
                    . .
                    . .
                    . |--------------------------| .
                    . | pannel1 | .
                    . |--------------------------| .
                    . |--------------------------| .
                    . | pannel2 | .
                    . |--------------------------| .
                    . | pannel3 | .
                    . |--------------------------| .
                    . .
                    . .
                    . .
                    . .
                    .......................................................................

                    so in above if i am saying panel1.hide so panel2 and panel3 should be on the place of panel1 and panel2 respectively i want to solve this one .. please help me ...

                    vikas da

                    T Offline
                    T Offline
                    Tuwing Sabado
                    wrote on last edited by
                    #9

                    Hi, What is the reason why you want to place those panels in one form and not creating 3 different forms? Is it you want to reuse the method, function and properties of form you've created and you don't want to repeat this codes in other form plus they have the same look and feel with some slight differences in Pane1, Panel 2 and Panel3. If your answer is YES you should go to inherited form. NOTE: Methods and Properties of Parent Form are visible to inherited Form (Only Public and Protected access modifiers). Parent Form

                    .......................................................................
                    . .
                    . .
                    . |--------------------------| .
                    . | Static Design | .
                    . |--------------------------|
                    . .
                    . .
                    . .
                    . |--------------------------| .
                    . | Area for | .
                    . | Other Panel | .
                    . |--------------------------| .

                    . .
                    . .
                    . .
                    . .
                    .......................................................................

                    Inherited Form Locked Static Design means you can only edited this on Parent Form.

                    .......................................................................
                    . .
                    . .
                    . |--------------------------| .
                    . | Locked - Static Design | .
                    . |--------------------------|
                    . .
                    . .
                    .

                    1 Reply Last reply
                    0
                    • T tasumisra

                      .......................................................................
                      . .
                      . .
                      . .
                      . .
                      . .
                      . .
                      . .
                      . |--------------------------| .
                      . | pannel1 | .
                      . |--------------------------| .
                      . |--------------------------| .
                      . | pannel2 | .
                      . |--------------------------| .
                      . | pannel3 | .
                      . |--------------------------| .
                      . .
                      . .
                      . .
                      . .
                      .......................................................................

                      so in above if i am saying panel1.hide so panel2 and panel3 should be on the place of panel1 and panel2 respectively i want to solve this one .. please help me ...

                      vikas da

                      T Offline
                      T Offline
                      Tuwing Sabado
                      wrote on last edited by
                      #10

                      No need for resizing, treat inherited forms as a new form with extra codes and design.

                      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