How can I know the text in a column of a list?
Printable View
How can I know the text in a column of a list?
VB Code:
MsgBox ListView1.SelectedItem.Text
But what if I need to combine the text of two columns? (I have four)
Code:MsgBox ListView1.SelectedItem.Text & ListView2.SelectedItem.Text
I meant two colomns in one ListView....
For Each ListItemX In ListView1.ListItems
If ListItemX.Selected = True Then
ListItemX.SubItems(ListView1.ColumnHeaders("Code").SubItemIndex)
End If
Next ListItemX
sorry, i misunderstodd!
I don't understand what you wrote...
What variable is the two texts from the listview1?
VB Code:
ListView1.SelectedItem.Text
Will give you the 1st columns text of the selected item.
VB Code:
ListView1.SelectedItem.ListSubItems(1).Text
Will give you the 2nd columns text of the selected item.
VB Code:
ListView1.SelectedItem.ListSubItems(2).Text
Will give you the 3rd columns text of the selected item.