943,947 Members | Top Members by Rank

Ad:
  • VB.NET Discussion Thread
  • Unsolved
  • Views: 24449
  • VB.NET RSS
You are currently viewing page 1 of this multi-page discussion thread
Oct 27th, 2004
-2

How do you switch between forms in vb.net?

Expand Post »
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
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
MasterNovice is offline Offline
1 posts
since Jul 2004
Dec 21st, 2004
0

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

Quote 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!
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Big Birtha is offline Offline
1 posts
since Dec 2004
Dec 21st, 2004
0

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

VB.NET Syntax (Toggle Plain Text)
  1. form2.Show
  2. form1.Hide

?? Not exactly sure ... I did something like that in middle school though!
Administrator
Staff Writer
Reputation Points: 1422
Solved Threads: 162
The Queen of DaniWeb
cscgal is offline Offline
13,645 posts
since Feb 2002
Jul 26th, 2007
0

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

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?
Reputation Points: 10
Solved Threads: 0
Newbie Poster
learningvb is offline Offline
2 posts
since Jul 2007
Jul 26th, 2007
0

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

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!!
Reputation Points: 10
Solved Threads: 0
Newbie Poster
learningvb is offline Offline
2 posts
since Jul 2007
Jul 26th, 2007
0

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

Do something like this on the on click event of the command button

VB.NET Syntax (Toggle Plain Text)
  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.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Seamus0291 is offline Offline
2 posts
since Jul 2007
Jul 27th, 2007
0

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

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....
Reputation Points: 5
Solved Threads: 1
Junior Poster in Training
preetham.saroja is offline Offline
82 posts
since Jun 2007
Jul 29th, 2007
0

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

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.
Reputation Points: 84
Solved Threads: 140
Posting Shark
QVeen72 is offline Offline
923 posts
since Nov 2006
Jul 29th, 2007
1

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

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
Reputation Points: 84
Solved Threads: 140
Posting Shark
QVeen72 is offline Offline
923 posts
since Nov 2006
Aug 14th, 2007
0

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

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
Reputation Points: 10
Solved Threads: 0
Newbie Poster
babaze is offline Offline
2 posts
since Aug 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in VB.NET Forum Timeline: datagrid_itemdatabound
Next Thread in VB.NET Forum Timeline: Help with appending text file





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC