|
-
Sep 7th, 2003, 12:01 AM
#1
Thread Starter
Hyperactive Member
Unload Form1
I have form1 and form2.
In Form1 load event I do this:
dim aForm as new Form2
aForm.Show
I have a button in form2. I've tried;
form1.close
but this code doesn't work!
please correct me.
-
Sep 11th, 2003, 06:32 AM
#2
Junior Member
does it recognize Form1 from Form2? Like in Form2 when you type Form1. does a list pop up as possible actions to take?
-
Sep 11th, 2003, 09:30 AM
#3
Sleep mode
If Form1 is the startup form of your proj , and you used Close() method , it will close the application not the form . Use instead , Hide() or Visible() methods set to False .
-
Sep 13th, 2003, 11:39 AM
#4
Addicted Member
In the form1 class , declare a private variable:
Private aForm as Form2
when you want to show form2 use:
aForm = New Form2
aForm .Show
when you want to close the form use:
aForm .Close
Basically, aForm was out of scope, and obvously, in production code, you should use a more descriptive names than 'aForm ' and 'Form2';
Last edited by PeteD; Sep 13th, 2003 at 06:58 PM.
-
Sep 13th, 2003, 04:03 PM
#5
Member
Instead of
From1.close
try
Unload Form1
Please don't discourage me, I never hurt anyone.
"You're watching FOX News channel, real journalism, fair and balanced." - Ha
-
Sep 13th, 2003, 04:47 PM
#6
Sleep mode
Originally posted by MixMaster
Instead of
From1.close
try
Unload Form1
lol...it's not VB6 dude , This keyword is no longer used in VB.NET
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
|