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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. how to resize panel accdg to form size

how to resize panel accdg to form size

Scheduled Pinned Locked Moved C#
questiongraphicstutorial
3 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.
  • E Offline
    E Offline
    edel_ong
    wrote on last edited by
    #1

    How can I resize a panel according to form size? I have the ff code: this.pnlGrndWv.Size = new System.Drawing.Size(this.Size.Width,this.Size.Height); This worked but what I actually wanted was to capture the size of form(with the excess page which i can view using scrollbar), I mean I want to know the size of the "long" windows form, I want to actually simulate ng Panel size to "real" form size. How can I do this? Thanks!

    L 1 Reply Last reply
    0
    • E edel_ong

      How can I resize a panel according to form size? I have the ff code: this.pnlGrndWv.Size = new System.Drawing.Size(this.Size.Width,this.Size.Height); This worked but what I actually wanted was to capture the size of form(with the excess page which i can view using scrollbar), I mean I want to know the size of the "long" windows form, I want to actually simulate ng Panel size to "real" form size. How can I do this? Thanks!

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

      Use this :

      this.pnlGrndWv.Dock = System.Windows.Forms.DockStyle.Fill;

      J 1 Reply Last reply
      0
      • L Lost User

        Use this :

        this.pnlGrndWv.Dock = System.Windows.Forms.DockStyle.Fill;

        J Offline
        J Offline
        Judah Gabriel Himango
        wrote on last edited by
        #3

        A dock will take up the entire area. If you don't want your control to take up the entire area, yet still resize according to its parent, use control.Anchor property.

        Tech, life, family, faith: Give me a visit. I'm currently blogging about: Islamic Domination: Coming to a Jewish state near you! The apostle Paul, modernly speaking: Epistles of Paul Judah Himango

        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