|
-
Oct 31st, 2002, 01:36 AM
#1
Thread Starter
Lively Member
showing form
like in vb 6, how can I unload a form and show another in VB.Net?
when in doubt, win the trick
-
Oct 31st, 2002, 01:40 AM
#2
if you wanna unload the current form:
me.close
to load another one:
dim frm as new form2
frm.show
rate my posts if they help ya!
Extract thumbnail without reading the whole image file: (C# - VB)
Apply texture to bitmaps: (C# - VB)
Extended console library: (VB)
Save JPEG with a certain quality (image compression): (C# - VB )
VB.NET to C# conversion tips!!
-
Oct 31st, 2002, 01:52 AM
#3
Thread Starter
Lively Member
hi thanx for your patience Mr.Polite
I tried that but getting an error while compiling
(ie; me.close())
variable 'Close' conflicts with sub 'Close' in the base class 'Form' and so should be declared 'Shadows'.
please help
when in doubt, win the trick
-
Oct 31st, 2002, 02:04 AM
#4
Me.Close() works. You probably have a variable named "close" in your form and as it says, it has a conflict with that. Just rename your variable. I guess that's the problem
I dont know about the Shadows keyword, never worked with it. I guess you could solve it without renaming it too
rate my posts if they help ya!
Extract thumbnail without reading the whole image file: (C# - VB)
Apply texture to bitmaps: (C# - VB)
Extended console library: (VB)
Save JPEG with a certain quality (image compression): (C# - VB )
VB.NET to C# conversion tips!!
-
Oct 31st, 2002, 03:41 AM
#5
Thread Starter
Lively Member
thanx mr.Polite
you were right.
now the problem is the next form is not showing. Instead the application exits. i have written in a button's
me.close()
dim frm as form2
frm.show
but it didn't work
i tried this also
dim frm as form2
frm.show
me.close()
can u help me?
when in doubt, win the trick
-
Oct 31st, 2002, 05:19 AM
#6
The first form opened maintains the thread of the application. If you close it then it closes the application also. You can use ShowDialog to show another form modally which will keep the main form from unloading until the new form is done.
-
Oct 31st, 2002, 08:31 AM
#7
Thread Starter
Lively Member
hi ednees
means we can't do as it in vb6. right?
when in doubt, win the trick
-
Oct 31st, 2002, 11:28 AM
#8
Right its a little bit different. We can't unload and load any forms anymore. Well we can just not the main form, any others will work like they did in vb6.
-
Oct 31st, 2002, 04:51 PM
#9
Frenzied Member
Try this and tell me if it helps : Add a new module to your application and create new instances of the forms in a sub main and then show the forms modally.
Code:
sub main()
dim f1 as new form1
dim f2 as new form2
'some codes to customize form1
f1.showdialog
'some codes to customze form2
f2.showdialog
end sub
in your form1 you should write some code to find out how the form is closed. for example if the user clicks a button to go to form2 you can have that button to act as dialog cancel button but there should be a difference between that and the exit button of the form.
-
Nov 1st, 2002, 01:34 AM
#10
Thread Starter
Lively Member
ya it's working. thanks Lunatic3.
when in doubt, win the trick
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
|