943,851 Members | Top Members by Rank

Ad:
  • VB.NET Discussion Thread
  • Unsolved
  • Views: 81202
  • VB.NET RSS
You are currently viewing page 1 of this multi-page discussion thread
Sep 28th, 2004
0

How can I show a form?

Expand Post »
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?
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
vbpro is offline Offline
2 posts
since Sep 2004
Oct 18th, 2004
0

Re: How can I show a form?

Quote originally posted by vbpro ...
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
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Mr.Stupid is offline Offline
2 posts
since Oct 2004
Nov 15th, 2004
0

Re: How can I show a form?

Quote originally posted by vbpro ...
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()
Reputation Points: 10
Solved Threads: 0
Newbie Poster
jayateertha_23 is offline Offline
1 posts
since Nov 2004
Nov 27th, 2008
0

Re: How can I show a form?

Click to Expand / Collapse  Quote originally posted by vbpro ...
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()
()
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Gayan Wijeratne is offline Offline
4 posts
since Nov 2008
Nov 27th, 2008
0

Re: How can I show a form?

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.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
isaackhazi is offline Offline
22 posts
since Sep 2008
Dec 5th, 2008
0

Re: How can I show a form?

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
Reputation Points: 10
Solved Threads: 1
Newbie Poster
K-Dave is offline Offline
18 posts
since Jan 2008
Dec 5th, 2008
0

Re: How can I show a form?

If you use the Form2.Show() that the shutdown mode is set to "When last forme closes" otherwise your program will quit.
Reputation Points: 84
Solved Threads: 58
Posting Pro in Training
waynespangler is offline Offline
461 posts
since Dec 2002
Dec 5th, 2008
0

Re: How can I show a form?

use .showdialog and then it will close when the caller is closed
Moderator
Featured Poster
Reputation Points: 1764
Solved Threads: 574
Moderator
jbennet is offline Offline
16,512 posts
since Apr 2005
Dec 6th, 2008
0

Re: How can I show a form?

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
Reputation Points: 10
Solved Threads: 1
Newbie Poster
K-Dave is offline Offline
18 posts
since Jan 2008
Dec 8th, 2008
0

Re: How can I show a form?

Click to Expand / Collapse  Quote originally posted by vbpro ...
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
Reputation Points: 10
Solved Threads: 0
Newbie Poster
sumithakb is offline Offline
2 posts
since Dec 2008

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.
This thread is currently closed and is not accepting any new replies.
Previous Thread in VB.NET Forum Timeline: passing multiple values in crystal report parameter field
Next Thread in VB.NET Forum Timeline: Accuracy of timer?





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


Follow us on Twitter


© 2011 DaniWeb® LLC