Hi,
I am a new user to VB.Net,i have worked previously with VB 6.In that we give (for eg:)form1.show to show a form and to hide we give form2.hide.How do we do this in VB.Net.I tried form1.activeform.show and hide but it is not working.
Printable View
Hi,
I am a new user to VB.Net,i have worked previously with VB 6.In that we give (for eg:)form1.show to show a form and to hide we give form2.hide.How do we do this in VB.Net.I tried form1.activeform.show and hide but it is not working.
Dear kaarthik,
add to forms to your project form1 and form2
in form1 add 2 buttons
in the form1's general declaration section add this line of code
Dim ff As New Form2
Now add the below given code to the two buttons click events
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
'Show the form object of form2 named ff
ff.Show()
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
'Hide the form object of form2 named ff
ff.Hide()
End Sub
Pramod S Nair
Take a look at Using Multiple Forms in VB.NET This article will make life easier when working in VB.NETQuote:
Originally Posted by kaarthik