> NonChild.Left = Child.Left + MDI.Left
NonChild.Top = Child.Top + MDI.Top
Hi, I've done that but I'm having problems with things like menu,
borders, frames etc..
I made the following code below that makes the 2 forms positioned
perfectly in the same location.
However, here...
----------------------------------
Me.Left = mdiVideoInspect ionGlobal.Left + iX_Border +
frmVideoPreview Global.Left + 2
Me.Top = mdiVideoInspect ionGlobal.Top + iCaptionHeight + iY_Menu +
frmVideoPreview Global.Top + iY_Border + 2
----------------------------------
Above is part of the code shown below, as you can see there is a plus
2 on both Me.Left & Me.Top, the plus 2 on both is critical for they
make the two forms positioned at the same location with each other.
With you have any clue on what the plus 2 are?
Here is a description of my application:
Title/Caption Bar
Single Menu Bar
B
O MDI-CHILD FORM
R
D
E
R
O
F
M
D
I
Code:
--------------------------------------------
Dim Left As Integer
Dim Top As Integer
Dim iCaptionHeight As Integer
Dim iX_Border As Integer
Dim iY_Border As Integer
Dim iY_Menu As Integer
Debug.WriteLine (GetSystemMetri cs(SM_CXBORDER) ) '1 'The width
and height, in pixels, of a window border.
Debug.WriteLine (GetSystemMetri cs(SM_CYBORDER) ) '1 'The width
and height, in pixels, of a window border.
Debug.WriteLine (GetSystemMetri cs(SM_CXFRAME)) '4
'Thickness, in pixels, of the sizing border around the perimeter of a
window that can be resized.
Debug.WriteLine (GetSystemMetri cs(SM_CYFRAME)) '4
'Thickness, in pixels, of the sizing border around the perimeter of a
window that can be resized.
Debug.WriteLine (GetSystemMetri cs(SM_CYMENU)) '19 'Height,
in pixels, of single-line menu bar.
Debug.WriteLine (GetSystemMetri cs(SM_CYCAPTION )) '19 'Height,
in pixels, of normal caption area.
iCaptionHeight = GetSystemMetric s(SM_CYCAPTION)
iX_Border = GetSystemMetric s(SM_CXFRAME)
iY_Border = GetSystemMetric s(SM_CYFRAME)
iY_Menu = GetSystemMetric s(SM_CYMENU)
Me.Left = mdiVideoInspect ionGlobal.Left + iX_Border +
frmVideoPreview Global.Left + 2
Me.Top = mdiVideoInspect ionGlobal.Top + iCaptionHeight +
iY_Menu + frmVideoPreview Global.Top + iY_Border + 2