Results 1 to 3 of 3

Thread: [RESOLVED] Reseting a CheckedListBox

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2005
    Location
    Lancashire UK
    Posts
    375

    Resolved [RESOLVED] Reseting a CheckedListBox

    Is there a command which will clear all the check boxes in a CheckedListBox control ?

    Or do I need to loop through each item and uncheck as required ?

    Thanks in advance for any help

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Reseting a CheckedListBox

    I'm sure you read the help topic for the CheckedListBox member listing, so to confirm your suspicions I'd say that the best method would be:
    VB Code:
    1. For i As Integer = 0 To myCLB.Items.Count - 1 Step 1
    2.     myCLB.SetItemChecked(i, False)
    3. Next i
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2005
    Location
    Lancashire UK
    Posts
    375

    Re: Reseting a CheckedListBox

    Thanks for your help JM

    Your correct, I did read through the member listing but could only find ClearSelected() which didn't do the trick, so given my limited knowledge I though I may be missing a trick

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width