Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
您如何计算列表框中被选中的值的数量,而不是列表框中的所有值?
我需要得到这个数字,然后把它变成一个字符串。一旦我有了数字,我就可以轻松地将其更改为字符串
谢谢
我已经使用 ListBox1.GetSelectedIndices.Length
yourlistbox.SelectedItems.Count
您可以像这样遍历列表框中的项目:
For Each item As ListItem In MyListBox.Items If item.Selected Then 'Do something End If Next