Form dispose closes other forms!!

  • Thread starter Thread starter aakashdee
  • Start date Start date
A

aakashdee

Hi all,

I have two forms namely form1 and form2. In form1, I write the code
to show the second form form2 and then I immediately dispose form1.
But the form2 which was opened also gets closed. Is there any way I
can keep form2 open irrespective of whether form1 is opened or not?. I
dont want to use this.Hide() as it occupies memory. Any help would be
greatly appreciated.

Thanx in advance
 
Why don't you just close Form1 instead of disposing it? IT will be disposed
after you close it, as long as there are no other references to it. At
least, I think it will. Hard to tell with that big-ass thread about
disposing forms over in microsoft.public.dotnet.languages.vb.

I'm doing this in the Click event of one of the buttons on my form:

Dim searchWin as SearchFilterForm = New SearchFilterForm()
searchWin.Show()
Me.Close()

And it works just fine.
Robin S.
 
Why don't you just close Form1 instead of disposing it? IT will be disposed
after you close it, as long as there are no other references to it. At
least, I think it will. Hard to tell with that big-ass thread about
disposing forms over in microsoft.public.dotnet.languages.vb.

I'm doing this in the Click event of one of the buttons on my form:

Dim searchWin as SearchFilterForm = New SearchFilterForm()
searchWin.Show()
Me.Close()

And it works just fine.
Robin S.


Thanx buddy :-)
 
Back
Top