Results 1 to 3 of 3

Thread: [RESOLVED] [2005] CheckedListBox

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Aug 2002
    Posts
    224

    Resolved [RESOLVED] [2005] CheckedListBox

    Hi,

    I have a CheckedListBox in my form.

    How I can uncheck items (example: 5 items that I Checked) without click of the mouse, OR to check all the items?

    Only with lines of code.

    Thanks in advance
    Last edited by yulyos; Dec 16th, 2006 at 12:25 PM.

  2. #2
    VB Addict Pradeep1210's Avatar
    Join Date
    Apr 2004
    Location
    Inside the CPU...
    Posts
    6,614

    Re: [2005] CheckedListBox

    Quote Originally Posted by yulyos
    Hi,

    I have a CheckedListBox in my form.

    How I can uncheck items (example: 5 items that I Checked) without click of the mouse, OR to check all the items?

    Only with lines of code.

    Thanks in advance
    The CheckedIndices collection keeps a list of all checked items.
    Use this to get/set the checked mark of the list item.

    Pradeep
    Pradeep, Microsoft MVP (Visual Basic)
    Please appreciate posts that have helped you by clicking icon on the left of the post.
    "A problem well stated is a problem half solved." — Charles F. Kettering

    Read articles on My Blog101 LINQ SamplesJSON ValidatorXML Schema Validator"How Do I" videos on MSDNVB.NET and C# ComparisonGood Coding PracticesVBForums Reputation SaverString EnumSuper Simple Tetris Game


    (2010-2013)
    NB: I do not answer coding questions via PM. If you want my help, then make a post and PM me it's link. If I can help, trust me I will...

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Aug 2002
    Posts
    224

    Re: [2005] CheckedListBox

    Hi,

    Thank you, I found the solution.

    VB Code:
    1. CheckedListBox1.BeginUpdate()
    2.         For i As Integer = 0 To CheckedListBox1.Items.Count - 1
    3.             'CheckedListBox1.SetItemCheckState(i, CheckState.Checked)
    4.             CheckedListBox1.SetItemCheckState(i, CheckState.Unchecked)
    5.         Next
    6. CheckedListBox1.EndUpdate()

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