0
我有一個列表框...我的列表框有多個項目..如果我選擇多個項目我想顯示多個項目同時在消息框..我的代碼是這樣的:選定的列表框值顯示togethar
cnt = LSTlocations.SelectedItems.Count
Dim list As New List(Of Integer)
Dim locid As Integer
If cnt > 0 Then
For i = 0 To cnt - 1
Dim locationanme As String = LSTlocations.SelectedItems(i).ToString
locid = RecordID("Locid", "Location_tbl", "LocName", locationanme)
list.Add(locid)
Next
For Each num In list
MessageBox.Show("LocID:" & num)
Next
現在每次我在消息框中獲得每個值..我想同時獲得所有的價值..我可以做到這一點?
我得到了put..if我從列表框中選擇兩個項目,我能夠在的messge框中按OK鍵兩次.. – user2878851
我總是想退出messagebox,如果我按確定按鈕 – user2878851
我刪除foreach ..現在我得到了正確的答案 – user2878851