Hi

I have a check list box.When user selects a specific value '(All)' I want to
uncheck all other check boxes in the list. How can I achieve this in code?

Thanks

Regards

Re: Checklist box code help needed by Cor

Cor
Sun Aug 20 02:56:54 CDT 2006

Tom,

If you detect that the all is checked than

remove the handler from the check event (or what you use)
than uncheck all boxes in a loop
check the all box again
add the handler again

And it is done,

If you want some sample code, than show at least the event that you are now
using.

I hope this helps,

Cor

"John" <John@nospam.infovis.co.uk> schreef in bericht
news:%23zM7zVAxGHA.4872@TK2MSFTNGP02.phx.gbl...
> Hi
>
> I have a check list box.When user selects a specific value '(All)' I want
> to uncheck all other check boxes in the list. How can I achieve this in
> code?
>
> Thanks
>
> Regards
>



Re: Checklist box code help needed by John

John
Wed Aug 23 11:15:06 CDT 2006

Thanks This worked. How can I make sure then when of the other options is
clicked then the All option is unticked?

Thanks again

Regards

"Lost" <lostagain@mailinator.com> wrote in message
news:44e85d72$0$17965$892e7fe2@authen.yellow.readfreenews.net...
> "John" <John@nospam.infovis.co.uk> wrote:
>
>>Hi
>>
>>I have a check list box.When user selects a specific value '(All)' I want
>>to
>>uncheck all other check boxes in the list. How can I achieve this in code?
>
> As it happens, I've just been doing something similar.
>
> I'll assume your 'All' item is the top one (item 0).
>
> Try this code:
>
> If CheckedListBox1.GetItemChecked(0) = True Then
> For i = 1 To CheckedListBox1.Items.Count - 1
> CheckedListBox1.SetItemChecked(i, False)
> Next i
> End If
>
> --
> This is soc.men, we know better. -- Michael Snyder