|
-
Oct 3rd, 2000, 02:48 AM
#1
Thread Starter
Lively Member
Create 4 forms and try this code from a module.
Form4 remains inside Form3, Form 3 remains inside Form2, Form2 remains inside Form1.
Code:
Declare Function SetParent Lib "user32" (ByVal hWndChild As Long, ByVal hWndNewParent As Long) As Long
Sub Main()
MsgBox "test"
Load Form1
Load Form2
Load Form3
Load Form4
SetParent Form4.hWnd, Form3.hWnd
SetParent Form3.hWnd, Form2.hWnd
SetParent Form2.hWnd, Form1.hWnd
Form1.Show
Form2.Show
Form3.Show
Form4.Show
End Sub
-
Oct 3rd, 2000, 07:43 AM
#2
Frenzied Member
Yeah that's indeed pretty cool but don't forget to place this in the parent form for nice unloading
Code:
Private Sub Form_Unload(Cancel As Integer)
Dim frm As Form
For Each frm In Forms
Unload frm
Set frm = Nothing
Next
'End isn't that rude anymore because everything is unloaded
End
End Sub
Jop - validweb.nl
Alcohol doesn't solve any problems, but then again, neither does milk.
-
Oct 3rd, 2000, 07:51 AM
#3
Fanatic Member
You can use this code te crash the computer:
Code:
Setparent Form1.hwnd, Form1.hwnd
-
Oct 3rd, 2000, 08:26 AM
#4
Very nice!!!
Keep puttin ones like those here (www.eeggs.com) vb trick here too.
oetje, why do you think he was trying to crash the pc?
-
Oct 3rd, 2000, 08:28 AM
#5
Fanatic Member
Originally posted by alex_read
oetje, why do you think he was trying to crash the pc?
I just wanted to say, that you must be careful when using setparent.
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
|