Openning main form in center of screen

Hi!

This is probably something simple, but I can't find anything in the

help files that tells me how to have the main form open up

in a specified area of the screen (ie...in the center of the screen)

instead of in the corner where it wants to put itself.

Can anyone tell me how?

Thank You!

Albert

ahammar@micron.net


Comments

  • : Hi!

    : This is probably something simple, but I can't find anything in the

    : help files that tells me how to have the main form open up

    : in a specified area of the screen (ie...in the center of the screen)

    : instead of in the corner where it wants to put itself.

    : Can anyone tell me how?

    : Thank You!

    : Albert

    : ahammar@micron.net


    On 1 line, usually in Form_Load:

    Move (Screen.Width - Me.Width) 2, (Screen.Height - Me.Height) 2


  • You coud do this a design time or run time it doesn't make any difference. To have a form center in the middle of the screen set Form.StartUpPosition = 2. You can do this in the Form Load routine or set it in the form properties panel.




    : Hi!

    : This is probably something simple, but I can't find anything in the

    : help files that tells me how to have the main form open up

    : in a specified area of the screen (ie...in the center of the screen)

    : instead of in the corner where it wants to put itself.

    : Can anyone tell me how?

    : Thank You!

    : Albert

    : ahammar@micron.net







Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories