I have main form which is MDI parent.
Inside I opened second (same solution, different project) form like this:
Dim f As New mynevproj.frm_list
With f
.MdiParent = Me
.Show()
End With
In those new form (frm_list) I open another new form in few instances:
Dim fa As New frm_art1
With fa
.StartPosition = FormStartPosition.Manual
.Location = New Point(Me.Location.X + 20 + (inst * 20), Me.Location.Y))
AddHandler .aClosed, AddressOf frm_artikl_Closed
.Show()
End With
What happens?
When I open few instances of frm_art1 and then closes frm_list I expect that all frm_art1 will be closed in order to closing frm_list.
But that doesn’t happen.
Every time I click (X) to close frm_list one instance of frm_art1 closes and finally when all frm_art1 was closed then frm_frm_list closes.
How to get that all forms opened through frm_list closes when I close frm_list.
This works good in non MDI enviroinment.
Now I try additionally this in form_closing of frm_list:
For Each frm As Form In My.Application.OpenForms
If frm.Name = "frm_art1" Then
frm.Close()
End If
Next
And this also doesn’t work!
Try making the frm_list the owner of the other forms: