|
-
Sep 30th, 2000, 11:32 AM
#1
Thread Starter
Hyperactive Member
I have a MDi form and when you click new on the menu it makes a new form1. When I click close I want it to close only the form1 that has focus. Is this even possible because I have tried many different ways of declaring variables and nothing is working. Thanks!!
-
Sep 30th, 2000, 11:35 AM
#2
This will close the ActiveForm.
Code:
Private Sub Command1_Click
Unload MDIForm1.ActiveForm
End Sub
-
Sep 30th, 2000, 12:36 PM
#3
Don't try that in VB6!
I did that before and I got 3 errors!
Here's a great way:
Code:
Set MDIForm.Activeform = Nothing
-
Sep 30th, 2000, 02:30 PM
#4
That doesn't unload a Form. The method I provided does.
-
Sep 30th, 2000, 06:28 PM
#5
Thread Starter
Hyperactive Member
hey thanks the Unload me.activeform works thanks a lot!!!
-
Sep 30th, 2000, 06:37 PM
#6
Well, Megatron, I don't know. My VB must be in a buggy mode. I've got SP4 now and I'll try that...or I'll use C++.
-
Sep 30th, 2000, 07:32 PM
#7
Escaflowne, in order to unload a form, you must use Unload MDIForm1.ActiveForm. But Set MDIForm.Activeform = Nothing can be used as well to clear up any resources that were being used, but not just by itself.
Code:
Private Sub Command1_Click()
Unload MDIForm1.ActiveForm
Set MDIForm.Activeform = Nothing
End Sub
-
Sep 30th, 2000, 07:53 PM
#8
Originally posted by Escaflowne
Well, Megatron, I don't know. My VB must be in a buggy mode. I've got SP4 now and I'll try that...or I'll use C++.
What error message do you get?
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
|