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

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!

form2.Show
form1.Hide

?? Not exactly sure ... I did something like that in middle school though!

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?

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!!

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

IF radiobutton1.checked = True OR 
    radiobutton2.checked = True
  THEN form2.displaydialog
 ELSE
    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.

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....

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

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

Comments
Good :)

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

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 ??

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

Answer:
1. Dim obj as new Form1
obj.MdiParent = Me
obj.show()
2. Just install .Net Framework

You can also use the Package and Deployment project. Also there are options like Install Shield and Click Once which is bundled with VS 2005.

If you are using any legacy COM components then you have packages those dll files and the correspinding interop files along with the application in the application folder.

This article has been dead for over six months. Start a new discussion instead.