Sign in to follow this  
stromchin

Rant about checkedlistbox not having multiple selection

Recommended Posts

Since this is a kind of a rant, sorry if this is the wrong forum.

ok, so I've been making this tool, and now I thought, hey, let's also activate multiple selection in this checkedlistbox, so that the artist can move more than one item at a time. or set the X values of more than one image at a time, or whatever.

SelectionMode -> MultiSimple
"Multiple selection is not supported on checkedlistboxes"
well, so now what do I do?

imagine photoshop, with layers. Each item in the checkedlistbox is a layer.
if you check it, then it's rendered, if not, it's not rendered. Pretty useful right?
and selecting more than 1 layer at a time? also very useful!

but no, I would have to implement some kind of archaic ?? next to the name, and then if they click on the first x pixels of the item, activate it or deactivate it.

Question is, why the hell wouldn't it support it?
it's derived from a listbox, and listbox can accept multiple selection

Share this post


Link to post
Share on other sites
I suppose your using the .Net CheckedListBox object. If not forget about this post.

While its true that you cannot select several items at once in that control, you can still check several items. Then you can retrieve the checked items using the [url="http://msdn.microsoft.com/fr-fr/library/system.windows.forms.checkedlistbox.checkeditems(v=vs.80).aspx"]CheckedItems[/url] property. There is even a [url="http://msdn.microsoft.com/fr-fr/library/system.windows.forms.checkedlistbox.itemcheck(v=vs.80).aspx"]ItemCheck[/url] event if you want to react to any change to an item's change status.

Share this post


Link to post
Share on other sites
[quote name='a_loho' timestamp='1307026165' post='4818678']
I suppose your using the .Net CheckedListBox object. If not forget about this post.

While its true that you cannot select several items at once in that control, you can still check several items. Then you can retrieve the checked items using the [url="http://msdn.microsoft.com/fr-fr/library/system.windows.forms.checkedlistbox.checkeditems%28v=vs.80%29.aspx"]CheckedItems[/url] property. There is even a [url="http://msdn.microsoft.com/fr-fr/library/system.windows.forms.checkedlistbox.itemcheck%28v=vs.80%29.aspx"]ItemCheck[/url] event if you want to react to any change to an item's change status.
[/quote]

I know I know... but I need the checks AND the selections. :(
I don't know how I'll end up doing it in the end

Share this post


Link to post
Share on other sites
You could use a ListView instead and set the view to Details. It has a Checkboxes property that put a checkbox on each row. Then you can access selected items (via Ctrl or shift) with SelectedItems properties and checked items with the CheckedItems property.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this