判断LISTBOX被选中解决思路
判断LISTBOX被选中VB.NET codeFor iCtr 1 To lstItem(pSrcIndex).Items.CountIf lstItem(pSrcIndex).It
判断LISTBOX被选中
VB.NET codeFor iCtr = 1 To lstItem(pSrcIndex).Items.Count 'If lstItem(pSrcIndex).Items(iCtr - 1).Selected Then End IfNext ictr
为什么在VS2010中没有SELECTED属性。
[解决办法]if (listBox1.GetSelected(index))
[解决办法] Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim i As Int16
For i = 0 To ListBox1.Items.Count - 1
If ListBox1.GetSelected(i) Then
MsgBox(i)
Exit For
End If
Next
End Sub
Private Sub Form3_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Dim i As Int16
For i = 0 To 5
ListBox1.Items.Add("yy" & i.ToString)
Next
End Sub