Private Sub WindowsMenu_DropDownOpening(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles WindowsMenu.DropDownOpening
If ActiveMdiChild Is Nothing Then
Return
End If
Dim sp As New ToolStripSeparator
sp.Name = "MdiWindowListSeperator"
WindowsMenu.DropDownItems.Add(sp)
For Each f As Form In MdiChildren
If Not f.Visible Then
Continue For
End If
WindowsMenu.DropDownItems.Add(New ToolStripMenuItem(f.Text, Nothing, AddressOf MDIChildren_Click) With {.Checked = ActiveMdiChild Is f, .Tag = f})
Next
End Sub
Private Sub MDIChildren_Click(ByVal sender As Object, ByVal e As EventArgs)
DirectCast(DirectCast(sender, ToolStripMenuItem).Tag, Form).Activate()
End Sub</pre></div>
Dim linq = From f In _ideForm.MdiChildren Where f.Visible Select f
If linq.Count = 0 Then
Return
End If
Dim sp As New ToolStripSeparator
sp.Name = seperatorKey
dropDownItems.Add(sp)
For Each f As Form In linq
dropDownItems.Add(New ToolStripMenuItem(f.Text, Nothing, AddressOf MDIChildren_Click) With {.Checked = _ideForm.ActiveMdiChild Is f, .Tag = f})
Next
End Sub</pre></div>