|
-
Jul 5th, 2000, 04:05 PM
#1
Thread Starter
Frenzied Member
If i have a standard form with a picture box on it. I want it so when you click a button it displays a form inside the picture box, to give the effect of 'MDI'.
-
Jul 5th, 2000, 04:10 PM
#2
Use the SetParent API.
Code:
Private Declare Function SetParent Lib "user32" (ByVal hWndChild As Long, ByVal hWndNewParent As Long) As Long
Private Sub Command1_Click()
SetParent Form2.hwnd, Picture1.hwnd
Form2.Show
End Sub
-
Jul 5th, 2000, 04:15 PM
#3
Multiple Documents
Better yet, use this code. It will allow multiple copies of Form2.
Code:
Private Declare Function SetParent Lib "user32" (ByVal hWndChild As Long, ByVal hWndNewParent As Long) As Long
Dim newForm As Form2
Private Sub Command1_Click()
Set newForm = New Form2
SetParent newForm.hwnd, Picture1.hwnd
newForm.Show
End Sub
-
Jul 6th, 2000, 12:11 PM
#4
Thread Starter
Frenzied Member
Cheers m8, exactly what i was looking for, ace bloke
-
Jan 13th, 2001, 04:11 PM
#5
New Member
thanks that code helped me out to
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|