PDA

Click to See Complete Forum and Search --> : (SetParent again) Converting non mdichild form to MdiChild at run time


vetti
Jun 26th, 2000, 07:35 PM
Hi VB Gurus,
Using SetParent API i have converted one Non mdiChild form to MdiChild. But facing following problems
"
The run time mdiChild form menu is not overlapping the MdiParent menu bar.I mean there will be two menu bar one is for MdiParent and one is for mdichild.
"

i am using following code to convert the NonMDichild form to mdiChild

------------------------------------------------------------

Public Sub pMakeMdiChild
(lChildHandle As Long, lParentHandle As Long)

Dim lResult As Long
On Error GoTo Errhandler

If lChildHandle = 0 Or lParentHandle = 0 Then
MsgBox "Windows handle is not proper"
GoTo Errhandler
End If
' Api Call
' Private Declare Function SetParent Lib "user32" 'ByVal
' hWndChild As Long, ByVal hWndNewParent As Long) As 'Long
lResult = SetParent(lChildHandle, lParentHandle)
Exit Sub
Errhandler:
If Not Err.Description = "" Then
MsgBox Err.Description
End If
End Sub

-----------------------------------------------------------
Please guide to solve this problem

thanks for guiding

regards
vetti