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. How can i change Windows Form in real time

How can i change Windows Form in real time

Scheduled Pinned Locked Moved C#
question
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.
  • L Offline
    L Offline
    Lost User
    wrote on last edited by
    #1

    Hi All I have some application that i need to get parameters from the user and open Windows Form in the size that this user choose. How can i change Windows Form in the run time ? [real time] ? Thanks.

    W D 2 Replies Last reply
    0
    • L Lost User

      Hi All I have some application that i need to get parameters from the user and open Windows Form in the size that this user choose. How can i change Windows Form in the run time ? [real time] ? Thanks.

      W Offline
      W Offline
      whizzs
      wrote on last edited by
      #2

      If you are changing the parent form then use: this.Size = new Size ( width, height ); if you are opening a new window then: Form form2 = new Form(); form2.Size = new Size(300,300);

      1 Reply Last reply
      0
      • L Lost User

        Hi All I have some application that i need to get parameters from the user and open Windows Form in the size that this user choose. How can i change Windows Form in the run time ? [real time] ? Thanks.

        D Offline
        D Offline
        Dan Neely
        wrote on last edited by
        #3

        Modify the Size atribute. To have a form resize itself do this: this.Size = new Size(width,height); You'll need to look into anchoring (or possiby docking) your controls to grow/reposition them when the form changes it's size. If you're using 05 you could also try the layout manager. In 03 for anything complex you might have to handle the resize event yourself.

        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