Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Identifying the selected listview checkbox 2

Status
Not open for further replies.

CodingIsFun

Programmer
Apr 9, 2004
134
US
Can someone give me a snippet that identifies the selected checkbox of a listview event.

I am trying to trap the the click event or mouseup on only the checkbox that is being toggled.

Thanks in advance.
 
The me.ListView1.CheckedItems gets you all the items checked:

Code:
        Dim listvwItem As ListViewItem
        For Each listvwItem In Me.ListView1.CheckedItems
            '** Whatever you want to do with each item
        Next
 
Thanks for the snippet Becks25Not.

Unfortunately, this focuses on the entire listview.

I would prefer to focus on the current row that has its status changed. Either checked or unchecked, depending on the users input.

Thanks in advance
 
Code:
Private Sub ListView1_ItemCheck(ByVal sender As Object, ByVal e As System.Windows.Forms.ItemCheckEventArgs) Handles ListView1.ItemCheck
        MsgBox(e.NewValue)
End Sub

You should be able to figure out how to use it from there.
 
Riverguy... that last reply u gave to codingisfun helped me out hehehe, i was looking fot the index of a checked item... and with e.index got it out..
thanks hehe
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top