Center an MDI Child in MDI form 
Author Message
 Center an MDI Child in MDI form

Is there any way of centering a mdi child in a mdi parent.  The
startupposition property does not work must i use code?

Thomas Lane



Sat, 07 Jul 2001 03:00:00 GMT  
 Center an MDI Child in MDI form
Thomas,

You will have to center the mdi child manually.

--
HTH
VB-Joker

PLEASE post ALL replies to newsgroup!


Quote:
>Is there any way of centering a mdi child in a mdi parent.  The
>startupposition property does not work must i use code?

>Thomas Lane



Sat, 07 Jul 2001 03:00:00 GMT  
 Center an MDI Child in MDI form
MDIChild forms as designed to position and size themselves. You should try not to interfere with them if you want to follow the design guidelines. If you really have to then you must call the form's Move method in the Form_Load event.

Regards,
Simon Jones
MillStream Design
Independent IT Consultants

Quote:

>Is there any way of centering a mdi child in a mdi parent.  The
>startupposition property does not work must i use code?



Sat, 07 Jul 2001 03:00:00 GMT  
 Center an MDI Child in MDI form
Thomas,   You can programmatically move the child form to  center which is
not too hard (if you need code, let me know and I will see if I can find the
code I use) or you can use a resize control which will do it for you (Like
our AgFastform - Demo available at http://www.AgendumSoftware.com)
--
Sincerely,

Todd B -  Agendum Software
** FREE Developer tools for download!  NEW release -  AG Fastform layout
tool just released!
http://www.AgendumSoftware.com

Quote:

>Is there any way of centering a mdi child in a mdi parent.  The
>startupposition property does not work must i use code?

>Thomas Lane



Mon, 09 Jul 2001 03:00:00 GMT  
 Center an MDI Child in MDI form
Thomas, here is a subroutine that I use to centre my MDI child forms.
My child forms have a BorderStyle = 1 ' fixed single.

Regards, Graeme

Public Sub CentreOnMDI(frm As Form)
' centre frm on frmMain's client area
    On Error Resume Next
    With frm
        .Move Top:=(mdiFormName.ScaleHeight - .Height) \ 2, _
              Left:=(mdiFormName.ScaleWidth - .Width) \ 2
    End With
End Sub



Sun, 15 Jul 2001 03:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

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

2. How do you center MDI and MDI Child with 1 chunk of code

3. Modifying object in MDI Parent form from MDI Child form

4. Make a reference to a MDI form with a reference of a MDI child form

5. MDI-Child form and positon on MDI-form

6. Developing OLE MDI Child forms displayed on Control MDI Form

7. MDI child forms on top of a picture on a MDI form

8. Help with MDI Forms and MDI child forms

9. Modal non MDI forms and Modeless MDI child forms in VB 5.0

10. Allow MDI Child form to overlap Aligned Picture Box in MDI Form

11. Having MDI form with MDI Child form in DLL

12. Accessing Objects on a Mdi Parent form from a Mdi Child form

 

 
Powered by phpBB® Forum Software