VB6 Windows Starting Position

Discussion in 'Software' started by ceal21c, Nov 30, 2006.

  1. ceal21c

    ceal21c Private E-2

    Hello,

    Can someone please tell me how I can force a form to startup at a specific x,y coordinate?
     
  2. matt.chugg

    matt.chugg MajorGeek

    You can you the Left and Top properties of the form.

    Code:
    Private Sub Form_Load()
        frmMain.Left = 100
        frmMain.Top = 100
    End Sub
    

    To set the position of the form in relation to the screen dimensions you can use the screen object.

    Code:
    Private Sub Form_Load()
        frmMain.Left = (Screen.Width - frmMain.Width) * 0.5
        frmMain.Top = (Screen.Height - frmMain.Height) * 0.5
    End Sub
    
     

MajorGeeks.Com Menu

Downloads All In One Tweaks \ Android \ Anti-Malware \ Anti-Virus \ Appearance \ Backup \ Browsers \ CD\DVD\Blu-Ray \ Covert Ops \ Drive Utilities \ Drivers \ Graphics \ Internet Tools \ Multimedia \ Networking \ Office Tools \ PC Games \ System Tools \ Mac/Apple/Ipad Downloads

Other News: Top Downloads \ News (Tech) \ Off Base (Other Websites News) \ Way Off Base (Offbeat Stories and Pics)

Social: Facebook \ YouTube \ Twitter \ Tumblr \ Pintrest \ RSS Feeds