0

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.

1 Answer 1

2

Try this

If e.KeyCode = Keys.Enter Then
  lvFabric.Items.add(New ListViewItem(txtFind.Text))
End If
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.