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. WindowStartPosition

WindowStartPosition

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.
  • G Offline
    G Offline
    gmhanna
    wrote on last edited by
    #1

    Hi, I've set my WindowStartPosition for the form to be centered. I am also changing the size of the form in the FormLoad event as some of the group boxes are not visible. When the form displays on the screen it's centered based on the OLD size, not the new size. Is there a better place to resize the form so that it remains centered, or a way to force the centering somehow? Thank you,

    Glenn

    W L 2 Replies Last reply
    0
    • G gmhanna

      Hi, I've set my WindowStartPosition for the form to be centered. I am also changing the size of the form in the FormLoad event as some of the group boxes are not visible. When the form displays on the screen it's centered based on the OLD size, not the new size. Is there a better place to resize the form so that it remains centered, or a way to force the centering somehow? Thank you,

      Glenn

      W Offline
      W Offline
      William Winner
      wrote on last edited by
      #2

      Have a look here: How to Center A Form in VB.NET and C#[^]

      1 Reply Last reply
      0
      • G gmhanna

        Hi, I've set my WindowStartPosition for the form to be centered. I am also changing the size of the form in the FormLoad event as some of the group boxes are not visible. When the form displays on the screen it's centered based on the OLD size, not the new size. Is there a better place to resize the form so that it remains centered, or a way to force the centering somehow? Thank you,

        Glenn

        L Offline
        L Offline
        Luc Pattyn
        wrote on last edited by
        #3

        set the Form.Size (or Width, or Height, or both) in the Form's constructor. Or, if they are constant, why not set them in Visual Designer; I use the properties pane for such purpose. :)

        Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]


        I only read formatted code with indentation, so please use PRE tags for code snippets.


        I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).


        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