1
我使用vb.net 我有一个列表框名称LSTlocations..i可以选择从该列表box..i正在获取特定位置的ID给一个列表多个位置varibale..so我给出这样的代码:值列表变量在vb.net
cnt = LSTlocations.SelectedItems.Count
Dim strname As String
If cnt > 0 Then
For i = 0 To cnt - 1
Dim locationanme As String = LSTlocations.SelectedItems(i).ToString
Dim locid As Integer = RecordID("Locid", "Location_tbl", "LocName", locationanme)
Dim list As New List(Of Integer)
list.Add(locid)
Next
End If
,但我没有得到我的所有seclected位置ID在我的名单varibale..how我可以从我的列表框中所有选定位置ID列出varable
。是的,先生正确 – user2878851
很难说外面。启动循环时,cnt的值是多少?你可以尝试添加显示的LSTlocation.SelectedItems(i)的值一个MessageBox,我想在清单上显示 – Steve
值,而不是数量的.. 。用逗号分隔,我怎么能这样做? – user2878851