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