|
-
March 1st, 2006, 12:36 AM
#1
How do we link two forms
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.
-
March 1st, 2006, 01:34 AM
#2
Re: How do we link two forms
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
-
March 1st, 2006, 04:50 AM
#3
Re: How do we link two forms
 Originally Posted by kaarthik
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 This article will make life easier when working in VB.NET
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|