How to center MDI child form 
Author Message
 How to center MDI child form

Is it possible to center the MDI form inside the MDI parent ?

Thanks.
Ferrong



Sat, 16 Oct 1999 03:00:00 GMT  
 How to center MDI child form

In the form load of the MDIChild form, you would place the centering
calculation for the Top and Left properties based upon the child forms
height and width and the MDI form's ScaleWidth and ScaleHeight

--

Michael A. Drawbaugh
"The VB Ace"
2601 Market Place
Harrisburg, PA  17110
USA

http://www.geocities.com/SiliconValley/Lakes/3150
"The dreams of today, are the tools of tomorrow..."



Quote:
> Is it possible to center the MDI form inside the MDI parent ?

> Thanks.
> Ferrong



Sun, 17 Oct 1999 03:00:00 GMT  
 How to center MDI child form

Quote:

> Is it possible to center the MDI form inside the MDI parent ?

Try this:

Sub CenterForm (frm As Form)

  Dim iTop As Integer, iLeft As Integer

  If frm.WindowState <> NORMAL Then Exit Sub

  If ShowStatusBar Then 'allow for a status bar. Forms(0) is the parent
    iTop = (Screen.Height - frm.Height - Forms(0)!StatusBar.Height) \ 2
    iLeft = (Screen.Width - frm.Width) \ 2
  Else
    iTop = (Screen.Height - frm.Height) \ 2 'just use these if you dont
    iLeft = (Screen.Width - frm.Width) \ 2  'have a status bar
  End If

  frm.Move iLeft, iTop

End Sub

MW



Mon, 18 Oct 1999 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Newbie Question - Center MDI child form

2. Center an MDI Child in MDI form

3. Q: Form activate Fires On Non Child MDI Forms But Only Once On Child Mdi Forms

4. MDI Child Form Centering

5. Centering MDI Child Form

6. center a child form in a MDI

7. Centering child form in MDI

8. Q: Centering an MDI Child Form

9. Center MDI Child Form

10. Centering a child form in an MDI Window

11. Centering child form in mdi window

12. How to center the MDI Child form when it is loaded

 

 
Powered by phpBB® Forum Software