Private Sub TextBox2_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles TextBox2.KeyDown If e.KeyCode = Keys.Enter Then ListView1.Items.Add(TextBox1.Text) ListView1.Items(ListView1.Items.Count - 1).SubItems.Add(TextBox2.Text) End if End Sub
Remove Multiple Selected Items For Each LVItem As ListViewItem In TransListView.SelectedItems LVItem.Remove() Next
good article
ReplyDeleteAdding Items to ListView from TextBoxes
ReplyDeletePrivate Sub TextBox2_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles TextBox2.KeyDown
If e.KeyCode = Keys.Enter Then
ListView1.Items.Add(TextBox1.Text)
ListView1.Items(ListView1.Items.Count - 1).SubItems.Add(TextBox2.Text)
End if
End Sub
Remove Multiple Selected Items
For Each LVItem As ListViewItem In TransListView.SelectedItems
LVItem.Remove()
Next
i think this is more clear!