Results 1 to 3 of 3

Thread: Centering Forms on Screen

  1. #1

    Thread Starter
    Member
    Join Date
    Sep 2000
    Posts
    55
    I heard there is a way to have a form centered directly in the middle of the screen when the program is ran. Can you tell me the code?

    Thanks



    Beres

  2. #2
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    <?>

    In design time, set the StartUpPositon property of the form to CenterScreen


    in code it looks like this:
    Code:
    Private Sub Form_Activate()
        Me.Left = (Screen.Width / 2) - (Me.Width / 2)
        Me.Top = (Screen.Height / 2) - (Me.Height / 2)
    End Sub
    [Edited by HeSaidJoe on 09-09-2000 at 11:23 PM]
    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

  3. #3
    Addicted Member
    Join Date
    Aug 2000
    Posts
    208
    in the form proprity, you can find
    START UP POSITION
    set at CENTER SCREEN

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width