我正在运行时创建 ToolStripMenuItem 的 DropDownItems。
Me.mnuExtrasSecondaryLCID.DropDownItems.Clear()
Dim iCount As Integer = -1
For Each nLang As clsLanguage In g_LCIDs
If nLang.IsLeader Then
iCount += 1
Dim n As New ToolStripMenuItem
n.Name = "mnuSecondaryLCID" & iCount.ToString()
n.Text = nLang.Title
n.Tag = nLang.LCID
n.Available = True
n.CheckOnClick = True
Me.mnuExtrasSecondaryLCID.DropDownItems.Add(n)
AddHandler n.Click, AddressOf Me.SecondaryLCIDClick
End If
Next
这工作正常。
然后,当我在运行时检查其中一个 DropDownItems 时,同一“列表”中的任何其他 DropDownItems 都会保持选中状态。相反,我只想检查一个(=最后点击的一个)。
是否有一个属性可以让我自动执行此操作,或者我是否需要通过手动取消选中所有其他 DropDropItems 来对此进行编码?