Parent Child Form

PatelNehal4u

Active member
Joined
Apr 6, 2009
Messages
25
Programming Experience
1-3
I have two form, Form1 and Form2.

Form1 have a button button1 which call the Form2
VB.NET:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim frm2 As New Form2
        frm2.Show()
    End Sub

Now if i close Form1 it will also close the Form2 and i dont want this, i want that form2 still works if i close the form1.

VB.NET:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Form2.show()
    End Sub

I also tried this but same problem.
 
On the Solution Explorer, right click you project and choose Properties. Then in the Application tab, go to Shutdown Mode and select "When last form closes".. Then your good to go :-D
 
Back
Top