I've created a second form for my project.How can I show it?
I find it's different from the VB6.The form.show , visible = true ... are not working now.
How can I do this?

Recommended Answers

All 12 Replies

I've created a second form for my project.How can I show it?
I find it's different from the VB6.The form.show , visible = true ... are not working now.
How can I do this?

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

Dim form2 As New Form2
form2.Show()

End Sub

I've created a second form for my project.How can I show it?
I find it's different from the VB6.The form.show , visible = true ... are not working now.
How can I do this?

declare a object for the second form and using the object show the form
like this
on click of a button of first form add this code

dim obj as new sec()
obj.show()

I've created a second form for my project.How can I show it?
I find it's different from the VB6.The form.show , visible = true ... are not working now.
How can I do this?

:'(

' create a object of the form

dim obj as new Form1
obj.show()
():)

u dont even have to create an object of the form.
just form2.show() if your calling it from another form and
Me.show() if your calling itself.

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Form2.Show() 'This code call the second form to be displayed
Me.Hide() ' This code hides the first form when the second form is displayed.
End Sub

If you use the Form2.Show() that the shutdown mode is set to "When last forme closes" otherwise your program will quit.

use .showdialog and then it will close when the caller is closed

Hi! Wayne The reply that i sent is working on my two forms. Remember the button1 is on the first form and that's where the code goes.

first form button 1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Form2.Show() 'This code call the second form to be displayed
Me.Hide() ' This code hides the first form when the second form is displayed.
End Sub

I've created a second form for my project.How can I show it?
I find it's different from the VB6.The form.show , visible = true ... are not working now.
How can I do this?

how to compile and run in VB.Net 2003

build -> compile
build -> run

?

i need help please. how do i show % sign i have made a text box showing percentage totals all i need is to put the percentage

Welcome @elephant381

Please do not resurrect old threads.If you have any questions please ask. You are welcome to start your own threads.

Thread Closed.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.