
2. Set Listview property
FullRowSelect = True
GridLines = True
UseCompatibleStateImageBehavior = False
View = Details
3. Using System.Windows.Forms.ListView
4. Sample code to add item to listview (When click button add item to listview)
Dim pObj As New ListViewItem("Code")
pObj.SubItems.Add("Item Name")
pObj.SubItems.Add("10.00")
pObj.SubItems.Add("1")
pObj.SubItems.Add("1.50"))
pObj.SubItems.Add("15.00")
pObj.Tag = 1 ' keep materail id ListView1.Items.Add(pObj)
5. Sample code to delete item in listview when press delete on keyboard.
Private Sub ListView1_KeyUp(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles lstMaterial.KeyUp
If e.KeyCode = Keys.Delete AndAlso ListView1.SelectedItems.Count > 0 Then
For i As Integer = ListView1.SelectedItems.Count - 1 To 0 Step -1
ListView1.Items.RemoveAt(ListView1.SelectedItems(i).Index)
Next
End If
End Sub
thanks for the interesting information
ReplyDeleteThanks for sharing ! Very useful.
ReplyDeleteVery helpful post.Thanks for sharing.
ReplyDeleteis that not like .net scripting ??
ReplyDeletePhotograph examinating released many of you and additionally it’s reasonably great thing. I will undoubtedly save your items your blog site.
ReplyDeleteyeezy
ReplyDeletecheap jordan shoes
fear of god hoodie
off white
yeezy gap hoodie
yeezys
nike travis scott
kyrie irving shoes
jordan outlet
a bathing ape