Reputation: 640
Here is my code:
If e.KeyCode = Keys.Enter Then
lvFabric.Items.Item(0).Text = txtFind.Text
End If
The code above is only specifying where the text should be added in the listview.
The flow of the whole function is first there is a textbox(txtFind),for example the user will input a text then press enter, after the user press enter the text will be added in the listview. the user will do this 3 times, what I want is how to automatically add text in listview without specifying the index.
Upvotes: 0
Views: 1719
Reputation: 4155
Try this
If e.KeyCode = Keys.Enter Then
lvFabric.Items.add(New ListViewItem(txtFind.Text))
End If
Upvotes: 2