For or Do statement for Listboxes in VB.NET [Resolved]
I have a listbox (currently project is in VB.NET but could do in VB6. The listbox contains a list of items. What would the syntax be for a For or Do statement that would perform an action for each item that is checked\highlighted?
IE. 6 names in a listbox, 3 are highlighted. What would the statement look like if I wanted a msgbox to pop-up for each of their names. Below is the syntax for VB6, I cannot figure out the syntax for VB.NET.
VB Code:
Dim n As Long, nCount As Long
nCount = List1.ListCount - 1
For n = 0 To nCount
If List1.Selected(n) Then
MsgBox List1.List(n)
End If
Next