article

Form Show

Email
Submitted on: 1/2/2015 1:58:00 AM
By: Hanafiah (from psc cd)  
Level: Beginner
User Rating: By 8 Users
Compatibility: VB.NET
Views: 1184
 
     vb6 Form.show method in vb.net

 
				I'm beginner in VB.Net, just to share some tips
Let says you have 2 form, Form_1 and Form_2. Inside Form_1 you have 1 command button called command_1. if you show Form_2 when press command_1. in VB6 just can use 

Form_2.show

But how to do it in vb.net?
Private Sub command_1_Click(ByVal Sender As Object, ByVal e as EventArgs) Handles command_1.Click
Dim frm As New Form_2()
frm.Show()
End Sub


but if you don't need to show new form2 every time you press command_1. just put your declaration outside your sub. like this

Dim frm As New Form_2()
Private Sub command_1_Click(ByVal Sender As Object, ByVal e as EventArgs) Handles command_1.Click
frm.Show()
End Sub


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this article (in the Beginner category)?
(The article with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments


 There are no comments on this submission.
 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular article, please click here instead.)
 

To post feedback, first please login.