bjwade62 Posted May 19, 2006 Posted May 19, 2006 Does anyone know how to get the imageindex of a listview item? I can get if I dim a variable and put it inside a For Each loop. I don't want it to run through a loop since I already know which item is selected. Here's what I'm trying to do. It doesn't work. Dim ListItem As ListViewItem If Button.MouseButtons = Windows.Forms.MouseButtons.Right And ListItem.ImageIndex = 5 Then Quote
Leaders snarfblam Posted May 20, 2006 Leaders Posted May 20, 2006 What are you looking for, specifically? The ImageIndex of the selected ListViewItem? Does this help? 'If user clicked with right mouse button ' and there is one and only one item selected ' and that item has an image index of five then... If e.Button = Windows.Forms.MouseButtons.Right _ AndAlso ListView1.SelectedItems.Count = 1 _ AndAlso ListView1.SelectedItems(0).ImageIndex = 5 Then 'Like, do things, and stuff... End If Quote [sIGPIC]e[/sIGPIC]
bjwade62 Posted May 22, 2006 Author Posted May 22, 2006 That's exactly what I wanted. Thanks! What are you looking for, specifically? The ImageIndex of the selected ListViewItem? Does this help? 'If user clicked with right mouse button ' and there is one and only one item selected ' and that item has an image index of five then... If e.Button = Windows.Forms.MouseButtons.Right _ AndAlso ListView1.SelectedItems.Count = 1 _ AndAlso ListView1.SelectedItems(0).ImageIndex = 5 Then 'Like, do things, and stuff... End If Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.