Torna al Thread
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
For Each f As Form In Me.MdiChildren
If CStr(f.Tag) = "ListView" Then
f.BringToFront()
Exit Sub
End If
Next 'f
ListViewxxx.Tag = "ListView" 'you get the idea: each type of form will get its own tag
ListViewxxx.MdiParent = Me
ListViewxxx.Show()
AddHandler ListViewxxx.FormClosing, AddressOf ListViewxxx_FormClosing
End Sub
Private Sub ListViewxxx_FormClosing(ByVal sender As Object, ByVal e As FormClosingEventArgs)
If e.CloseReason <> CloseReason.MdiFormClosing Then
e.Cancel = True
' Nascondo il form
CType(sender, ListView).Visible = False
ListViewxxx.MinimizeBox = True
End If
End Sub