Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

The child form position in MDI

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
0
0
Hello,

I have set the MDI and a child form. So whenever the MDI loads, the child form loads too. But I want to change the position of the child form. Instead of displaying on left,I want to display on center. Is this possible?

-John
 
Try passing the form you want to center into this procedure:

Public Sub FormCentre(frmCurrent As Form)

Dim iWindowLeft As Integer ' window left corner
Dim iWindowTop As Integer ' window top corner

iWindowLeft = (Screen.Width/2) - (frmCurrent.Width/2)
iWindowTop = (Screen.Height/2) - (frmCurrent.Height/2)

frmCurrent.Move iWindowLeft, iWindowTop
End Sub


Min.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top