
Centering child form in mdi window
Heres some code to center a MDI child form;
Public Sub Centerchild(Parent As Form, Child As Form)
'Type: Public Sub
'Name: CenterChild
'Purpose: Center a child form within an MDI form
'Limitations: none
'Author: Veign
'Arguments: Parent is the MDI parent form, Child is the child form to center
'Return Value:
'Useage: Centerchild(myMDIForm, myChildForm)
'Notes:
Dim iTop As Integer
Dim iLeft As Integer
If Parent.WindowState = vbMinimized Then Exit Sub
iTop = ((Parent.ScaleHeight - Child.Height) \ 2)
iLeft = ((Parent.ScaleWidth - Child.Width) \ 2)
Child.Move iLeft, iTop
End Sub
What Ken said is true, since its a splash screen theres no need for making
it a child form but I posted the code anyway...
--
Veign
www.veign.com
NEW ActiveX Control - Jeweled Style Buttons
www.veign.com/download_activex.html#jwldbutn
Code Samples & Sample Projects
http://www.veign.com/information/application/info_app.html
Submit Your Best Code (you keep the rights)
http://www.veign.com/information/application/code_submit.html
---------
Quote:
> Hi There,
> If this is in the wrong group, please inform me and I will
> repost to the corrct one.
> I am developing a simple MDI app in VB6, and have a splash
> screen that loads on start of the application. I am
> trying to set the position to be centreowner, but whenever
> I try to change the property from Normal - I get a message
> stating "invalid property value".
> Any advice on what I'm doing wrong (i am an amateur I'm
> afraid to admit!!) will be gratefully received!!
> TYIA