954,515 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

How can I show a form?

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?

vbpro
Newbie Poster
2 posts since Sep 2004
Reputation Points: 10
Solved Threads: 0
 
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

Mr.Stupid
Newbie Poster
2 posts since Oct 2004
Reputation Points: 10
Solved Threads: 0
 
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()

jayateertha_23
Newbie Poster
1 post since Nov 2004
Reputation Points: 10
Solved Threads: 0
 
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()
():)

Gayan Wijeratne
Newbie Poster
4 posts since Nov 2008
Reputation Points: 10
Solved Threads: 0
 

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.

isaackhazi
Newbie Poster
22 posts since Sep 2008
Reputation Points: 10
Solved Threads: 0
 

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

K-Dave
Newbie Poster
18 posts since Jan 2008
Reputation Points: 10
Solved Threads: 1
 

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

waynespangler
Posting Pro in Training
461 posts since Dec 2002
Reputation Points: 84
Solved Threads: 58
 

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

jbennet
Moderator
Moderator
18,523 posts since Apr 2005
Reputation Points: 1,826
Solved Threads: 601
 

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

K-Dave
Newbie Poster
18 posts since Jan 2008
Reputation Points: 10
Solved Threads: 1
 
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

sumithakb
Newbie Poster
2 posts since Dec 2008
Reputation Points: 10
Solved Threads: 0
 

build -> compile
build -> run

?

jbennet
Moderator
Moderator
18,523 posts since Apr 2005
Reputation Points: 1,826
Solved Threads: 601
 

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

elephant381
Newbie Poster
1 post since May 2010
Reputation Points: 10
Solved Threads: 0
 

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.

__avd
Posting Genius (adatapost)
Moderator
8,648 posts since Oct 2008
Reputation Points: 2,136
Solved Threads: 1,241
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You