Is there a event detect change of Listview item count? Like it will be trigger whenever i add an item or delete an item form listview. I search on MSDN Listview Event member, but cant c any usefull. Any help would be please:) Thanks
I have made you a user control that may get you started on the road to what you want.
Right click your project and add a new User Control, on that user control draw a ListView that covers the entire designer view and call it "lvView".
Now in the code view copy and paste this:
Public Class CustomLV
Public Sub AddItem(ByVal Item As ListViewItem)
MessageBox.Show("Add post-adding code here")
Now you will be able to use the CustomLV control as you would a ListView but you will have access to an AddItem method that will add an item to the encapsulated ListView and will execute whatever code you want afterwards, like this:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim item As ListViewItem
item = New ListViewItem("example")
Every time I press the button it will add an item with the text "example" and will automatically show the message box every time I do so. You would also be able to directly access the ListView by using
Hope that helps you achieve what you desire.
Edit: I have attached a ZIP file with the files for this user control in case you have any troubles recreating it yourself.