Hmm.. That's kind of a strange question..
You say get the index of an item checked, then check it
if it is unchecked? The only way I can interpret this is:
Get the index of an item TO SEE IF IT IS checked, then
check it if not.
There are ways to do that, but my experiences with the
CheckListBox control are not necessarily good ones. I'm
still hoping that I can find a better way than what I have
written to manipulate that control.
Now, get this:
I wrote an application that was just perfect for the CLB
control, and it worked great. That is, until I started to
add options that I would like to have. What I wanted to
do was generate a set of data, populate the CLB with it,
and then (at my leisure) check the ones I wanted to keep
OR check the ones I wanted to discard. When the list is
very large, sometimes it's handier to check the ones you
want, and other times it's handier to check the ones that
you DON'T want. So, after I had checked either, I wanted
to write a routine to get rid of either the checked or the
unchecked. I went through all of the methods, properties,
etc. for hours without finding a simple way to do this. At
the end, I had to write some pretty complicated
algorithms to update the CLB with the items left from
either checked or unchecked. It wasn't fun and took a
very long time to figure out since there are no easy
built-in methods to do this. I did it, though, and you as
well might find that sometimes you have to do it the
hard way. I'm still thinking about publishing those
algoritms though, but I've been holding out just in case
there IS a simpler way to do it!