我知道这是很简单的东西,它的滑落我的我的现在。我怎么循环,虽然一个列表框,选择的内容?
这里的code我做了现在:
昏暗allGrps作为整数
昏暗我作为整数
allGrps = lstAllGroups.ListCount
对于i = 1到allGrps
lstAllGroups
下一个
解决方案
请记住,列表框的索引从零开始,所以你一定要减一关,从我:
对于i = 1到allGrps
lstAllGroups.Selected(I - 1)=真
接下来我
另外,还要确保你有 SelectSheetsList.MultiSelect = fmMultiSelectMulti
,以便能够在列表中选择多个项目。
请参阅 ListBox中的文档了解更多信息。
I know this is something really simple and it's slipping my mine right now. how do I loop though a listbox and select the contents?
Here's the code I've made right now:
Dim allGrps As Integer
Dim i As Integer
allGrps = lstAllGroups.ListCount
For i = 1 To allGrps
lstAllGroups
Next
解决方案
Keep in mind that the listbox is zero-indexed so you've got to subtract one off from i:
For i = 1 To allGrps
lstAllGroups.Selected(i - 1) = True
Next i
Also, make sure you've got SelectSheetsList.MultiSelect = fmMultiSelectMulti
in order to be able to select multiple items in the list.
See the ListBox documentation for more info.
上一篇:焦点返回到编辑器中单击MAC的浮动窗口的按钮后,单击、按钮、器中、窗口
下一篇:保持UID和PWD了一个ADO连接字符串中的ODBC DSN的数据库和DAO缓存的连接?字符串、缓存、数据库、PWD