📜  菜单就像单选按钮 vb.net - VBA 代码示例

📅  最后修改于: 2022-03-11 14:51:54.952000             🧑  作者: Mango

代码示例1
' Uncheck all menu items in this menu except checked_item.
Private Sub CheckMenuItem(ByVal mnu As ToolStripMenuItem, _
    ByVal checked_item As ToolStripMenuItem)
    ' Uncheck the menu items except checked_item.
    For Each item As ToolStripItem In mnu.DropDownItems
        If (TypeOf item Is ToolStripMenuItem) Then
            Dim menu_item As ToolStripMenuItem = _
                DirectCast(item, ToolStripMenuItem)
            menu_item.Checked = (menu_item Is checked_item)
        End If
    Next item
End Sub