Cant use a VERY easy and basic form feature in VB.Net, coming from VB6
Posted on 2004-10-16
Well, this is an easy question I suppose, but I couldn't figure out how to use this in VB.NET using MSDN.
Suppose I have 2 forms, each has a button.
I want it so that if I press the button on form1 it will disappear and form2 appear, the same with form2.
When I press the button on form2 it should disappear and form1 appear.
Now, declaring a form2 type variable in form1 and assigning it to in the initialization in the designer code region:
Frm2 = New Form2(Me)
Then a function in form2 would:
Public Sub New(ByVal host As System.Windows.Forms.Form)
Frm1 = host
When Frm1 is type Form1.
Then I used the following fuctions to make the forms appear and disappear, in form1:
Well It opened Form2 as needed and form1 disappeared, but when i pressed the button on Form2 it would just show a blank form, a real NEW form.
How do I make it right?