Reputation: 1357
This is my ListView, Column 1 for ID and Column 2 for Notes
I have a Multi-Line textbox and a Button Like this
I want to load the selected note on the textbox when the button is clicked. How can I do this ?
Upvotes: 0
Views: 46715
Reputation: 108937
You can try something similar to this (you'll have to tweak it for your setup)
If listView.SelectedItems.Count > 0 Then
textBox.Text = listView.SelectedItems(0).SubItems(1).Text
End If
if you don't like the idea of using column index and if you have your columns setup right then you should be able to do .SubItems("ID").Text
Upvotes: 5
Reputation: 11
the following may work
For Each item As ListViewItem In ListView1.SelectedItems()
TextBox1.AppendText(item.Text & ":" & item.SubItems(1).Text & Environment.NewLine)
Next
Upvotes: 0