Click to See Complete Forum and Search --> : Double-clicking a checked list box


brouse
09-05-2007, 07:04 PM
I am using a checked listbox. I would like to perform an action if the user double-clicks on an item in the list. However, the double-click event "e" parameter doesn't give me any indication about which item is being double-clicked on. It seems like this information would be an obvious thing to want to have.

I've also noticed that the "SelectedItem" property for the checked listbox doesn't have a "checked" property, so I can't just check to see if the selected item is checked.

I gotta say I am having severe readjustment grumpiness going from VB6 to VB.NET, when things like this that should be simple to figure out are such a pain.

Phil Weber
09-05-2007, 07:28 PM
Doesn't the SelectedItem property return the item that was double-clicked? You can do this to see if the SelectedItem is checked:

Dim IsSelectedItemChecked As Boolean = CheckedListBox1.CheckedIndices.Contains(CheckedListBox1.SelectedIndex)

brouse
09-06-2007, 08:26 AM
okay, I can use that, thanks.

but you gotta admit - that's not exactly intuitive...