Click to See Complete Forum and Search --> : How do we link two forms
kaarthik
February 28th, 2006, 11:36 PM
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.
PramodsNair
March 1st, 2006, 12:34 AM
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
Shuja Ali
March 1st, 2006, 03:50 AM
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.
Take a look at Using Multiple Forms in VB.NET (http://www.devcity.net/Articles/94/1/multipleforms.aspx) This article will make life easier when working in VB.NET
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.