Current location: Hot Scripts Forums » Programming Languages » Windows .NET Programming » VB.NET - Show another form?


VB.NET - Show another form?

Reply
  #1 (permalink)  
Old 06-08-03, 08:30 AM
Tesco Tesco is offline
ASP Guru
 
Join Date: Jun 2003
Location: UK
Posts: 91
Thanks: 0
Thanked 0 Times in 0 Posts
VB.NET - Show another form?

I've *just* started in VB.NET (althought I've been doing ASP VB for a while). My question is, if I have two forms, say Form1.vb and Form2.vb how do I display Form2.vb when a button in Form1.vb is clicked?

I've got my sub setup, but I just don't know what I should put in it.. Anyone kow?

Thanks!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 06-08-03, 08:50 AM
Chris Boulton Chris Boulton is offline
Wannabe Coder
 
Join Date: Jun 2003
Location: Sydney, Australia
Posts: 208
Thanks: 0
Thanked 0 Times in 0 Posts
I dont actually use VB.NET (still using 6.0 because i dont like how the new FrameWork is needed)..

But in VB 6.0 you use

FormName.Show to show a form
FormName.Hide to hide a form

It should be the same for .NET, or similar anyway

__________________
Chris Boulton
SurfiOnline!
MyBulletinBoard
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #3 (permalink)  
Old 06-08-03, 09:10 AM
Tesco Tesco is offline
ASP Guru
 
Join Date: Jun 2003
Location: UK
Posts: 91
Thanks: 0
Thanked 0 Times in 0 Posts
Thats what I tried to use, but instead of using FormName.Show VS told me I need to declare a variable, and then use VarName.Show - so I declared a variable with the value Form2, but now I'm getting114): 'Form2' is a type and cannot be used as an expression.

My code is:
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim Button2Open
Button2Open = Form2
Button2Open.Show()
End Sub

Any ideas?
Thanks!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #4 (permalink)  
Old 06-08-03, 09:36 AM
Chris Boulton Chris Boulton is offline
Wannabe Coder
 
Join Date: Jun 2003
Location: Sydney, Australia
Posts: 208
Thanks: 0
Thanked 0 Times in 0 Posts
Have you tried Form2.Show() or even Form2.Show without the paranthesis?
__________________
Chris Boulton
SurfiOnline!
MyBulletinBoard
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #5 (permalink)  
Old 06-08-03, 09:38 AM
Chris Boulton Chris Boulton is offline
Wannabe Coder
 
Join Date: Jun 2003
Location: Sydney, Australia
Posts: 208
Thanks: 0
Thanked 0 Times in 0 Posts
hmmm

Dim Button2Open As New Form2
Button2Open.Show()

You may have to modify it a little (im not exactly sure)
__________________
Chris Boulton
SurfiOnline!
MyBulletinBoard
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #6 (permalink)  
Old 06-08-03, 09:55 AM
Tesco Tesco is offline
ASP Guru
 
Join Date: Jun 2003
Location: UK
Posts: 91
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally posted by Chris Boulton
Have you tried Form2.Show() or even Form2.Show without the paranthesis?
Yea I tried, but it didn't work

Quote:
Dim Button2Open As New Form2
Button2Open.Show()
That works! Thanks a lot!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #7 (permalink)  
Old 06-08-03, 10:40 PM
Chris Boulton Chris Boulton is offline
Wannabe Coder
 
Join Date: Jun 2003
Location: Sydney, Australia
Posts: 208
Thanks: 0
Thanked 0 Times in 0 Posts
No problem!

Was a pretty good guess as well, was just thinking back to when i wanted new instances of the same form to show.

Maybe i will get VB.net someday.. I just don't like how the new framework is required.. lots of users havent updated to it.
__________________
Chris Boulton
SurfiOnline!
MyBulletinBoard
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #8 (permalink)  
Old 06-09-03, 03:25 AM
Tesco Tesco is offline
ASP Guru
 
Join Date: Jun 2003
Location: UK
Posts: 91
Thanks: 0
Thanked 0 Times in 0 Posts
Yeah, I know what you mean.

But, if you think of VB6, that required runtime on the users computer to run, and VB.NET just requires the Framework.

I think in MS's next OS, they'll include the framework as standard (avoid upgrade issues). They couldn't get in XP because it wasn't finished by that time IIRC. Then we won't have to worry about things like that .
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #9 (permalink)  
Old 06-09-03, 07:58 AM
Chris Boulton Chris Boulton is offline
Wannabe Coder
 
Join Date: Jun 2003
Location: Sydney, Australia
Posts: 208
Thanks: 0
Thanked 0 Times in 0 Posts
Well.. basically.. the runtime files have been included since windows 95 so its not really an issue. And not to mention there are alot of applications which use them so people usually have updated versions.
__________________
Chris Boulton
SurfiOnline!
MyBulletinBoard
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #10 (permalink)  
Old 10-02-03, 03:32 AM
PeterSo PeterSo is offline
New Member
 
Join Date: Oct 2003
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Talking

Good Day, Tesco and Chris Boulton,

Nice to meet you!! I am new in VB .NET programming languages as well. So glad to meet and learn from your sharing info here.

I hope we can share and learn to each others from here.
Do you guys mind i join in?

THANK You!!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Checkboxes on form = mailto recipient. Bojon PHP 4 12-21-04 07:07 PM
SQL database registration form help vinhkhuong PHP 3 10-10-03 04:49 AM
send email when sending form (asp) bmatth1 Script Requests 0 09-30-03 06:52 AM
asp: URGENT! need to change code to create new form per id seala ASP 2 09-09-03 10:54 PM
close form sasi ASP 4 08-26-03 04:51 AM


All times are GMT -5. The time now is 09:22 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.