How do you switch between forms in vb.net?

Please support our VB.NET advertiser: Intel Parallel Studio Home
Reply

Join Date: Jul 2004
Posts: 1
Reputation: MasterNovice is an unknown quantity at this point 
Solved Threads: 0
MasterNovice MasterNovice is offline Offline
Newbie Poster

How do you switch between forms in vb.net?

 
0
  #1
Oct 27th, 2004
I am learing vb.net currently on my own and I have two questions.

1. How do you switch between forms via a button command?

2. I have .net student version and I would like to know how to package a .exe for a computer without .net installed.

These are driving me crazy - I can do it in VB6 but I am lost here.

Thank you for any help,

Greg
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 1
Reputation: Big Birtha is an unknown quantity at this point 
Solved Threads: 0
Big Birtha Big Birtha is offline Offline
Newbie Poster

Re: How do you switch between forms in vb.net?

 
0
  #2
Dec 21st, 2004
Originally Posted by MasterNovice
I am learing vb.net currently on my own and I have two questions.

1. How do you switch between forms via a button command?

2. I have .net student version and I would like to know how to package a .exe for a computer without .net installed.

These are driving me crazy - I can do it in VB6 but I am lost here.

Thank you for any help,

Greg
Can you please tell me how to do it on VB6? Its killing me too!
Reply With Quote Quick reply to this message  
Join Date: Feb 2002
Posts: 12,047
Reputation: cscgal is a glorious beacon of light cscgal is a glorious beacon of light cscgal is a glorious beacon of light cscgal is a glorious beacon of light cscgal is a glorious beacon of light cscgal is a glorious beacon of light 
Solved Threads: 129
Administrator
Staff Writer
cscgal's Avatar
cscgal cscgal is online now Online
The Queen of DaniWeb

Re: How do you switch between forms in vb.net?

 
0
  #3
Dec 21st, 2004
  1. form2.Show
  2. form1.Hide

?? Not exactly sure ... I did something like that in middle school though!
Dani the Computer Science Gal
Follow my Twitter feed! twitter.com/DaniWeb
And if you're interested in Internet marketing there is twitter.com/DaniWebAds
Reply With Quote Quick reply to this message  
Join Date: Jul 2007
Posts: 2
Reputation: learningvb is an unknown quantity at this point 
Solved Threads: 0
learningvb learningvb is offline Offline
Newbie Poster

Re: How do you switch between forms in vb.net?

 
0
  #4
Jul 26th, 2007
what if form1 has three radio buttons and a command button. clicking one of the fist two buttons and the command button should open form2 and clicking third radio button and the command button should open form2. How do u code it in VB.Net?
Reply With Quote Quick reply to this message  
Join Date: Jul 2007
Posts: 2
Reputation: learningvb is an unknown quantity at this point 
Solved Threads: 0
learningvb learningvb is offline Offline
Newbie Poster

Re: How do you switch between forms in vb.net?

 
0
  #5
Jul 26th, 2007
what if form1 has three radio buttons and a command button. clicking one of the fist two buttons and the command button should open form2 and clicking third radio button and the command button should open form3. How do u code it in VB.Net?...wrote the question wrong first time!!
Reply With Quote Quick reply to this message  
Join Date: Jul 2007
Posts: 2
Reputation: Seamus0291 is an unknown quantity at this point 
Solved Threads: 0
Seamus0291 Seamus0291 is offline Offline
Newbie Poster

Re: How do you switch between forms in vb.net?

 
0
  #6
Jul 26th, 2007
Do something like this on the on click event of the command button

  1. IF radiobutton1.checked = True OR
  2. radiobutton2.checked = True
  3. THEN form2.displaydialog
  4. ELSE
  5. form3.displaydialog

You can use a case statement also but I do recommend using the form.displaydialog as opposed to form.show that way you can't move back to the parent form until the opened one is closed. You can also hide the parent form by adding in form.hide.
Last edited by Seamus0291; Jul 26th, 2007 at 8:50 pm. Reason: BB code not set.
Reply With Quote Quick reply to this message  
Join Date: Jun 2007
Posts: 82
Reputation: preetham.saroja is an unknown quantity at this point 
Solved Threads: 1
preetham.saroja's Avatar
preetham.saroja preetham.saroja is offline Offline
Junior Poster in Training

Re: How do you switch between forms in vb.net?

 
0
  #7
Jul 27th, 2007
its so simple,to switch between forms--using command button
onclick () event of command button-just write has response.redirect("tothepage.aspx")

2)And to create .exe for an web-project..on the project name-right click& click on build solution,,,,
If i am,n2 correct -plz specify what is wrong....
Reply With Quote Quick reply to this message  
Join Date: Nov 2006
Posts: 848
Reputation: QVeen72 is on a distinguished road 
Solved Threads: 120
QVeen72's Avatar
QVeen72 QVeen72 is offline Offline
Practically a Posting Shark

Re: How do you switch between forms in vb.net?

 
0
  #8
Jul 29th, 2007
Hi,

write this code in Command Click event:

If RadioButton1.Checked = True Or RadioButton2.Checked=True  Then
 Form1.Show
Else
 Form2.Show
End if

Regards
Veena
Last edited by QVeen72; Jul 29th, 2007 at 8:53 am.
Reply With Quote Quick reply to this message  
Join Date: Nov 2006
Posts: 848
Reputation: QVeen72 is on a distinguished road 
Solved Threads: 120
QVeen72's Avatar
QVeen72 QVeen72 is offline Offline
Practically a Posting Shark

Re: How do you switch between forms in vb.net?

 
1
  #9
Jul 29th, 2007
Hi,

Every time u Build and run ur project, An "Exe" file is created in The "Bin" folder of the application path, u can use this Exe to re-distribute.
To Create Set-up Package Check This
In Client machine u have to install "Runtime .Net Framework", And Run The Set-Up Created above.

Regards
Veena
Reply With Quote Quick reply to this message  
Join Date: Aug 2007
Posts: 2
Reputation: babaze is an unknown quantity at this point 
Solved Threads: 0
babaze babaze is offline Offline
Newbie Poster

Re: How do you switch between forms in vb.net?

 
0
  #10
Aug 14th, 2007
I have similar problem .
Ihave 2 forms , iwant to enter variables on form1 and show them in form2
This what i have soo far
form1
=====
Private Sub Button1_Click(val blala)
Fnamesender = TextBox2.Text
Me.Hide()
Form2.Show()

End Sub

form2
=====
Private Sub Form2_Load(ByVal blabla bla)

Label.text = Fnamesender
end sub

i have a mudule
===========
Module one
Public Fnamesender As String

end module


The Problem is when i enter a text in TextBox2 in form1 and view it in Label its ok , but if you go back to form1 and enter a name in textBox2 it doesnt change in label . how can i clear label.text
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC