• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 301
  • Last Modified:

How to do a For Each... Next on a CheckedListItem ? ?? ?? (URGENT)

Hi Experts...Please, heeeeeelp....Desperate....

I wanna do this :

 Dim ListEle As New "LISTITEM"   --->  LISTITEM does not EXIST

        For Each ListEle In CheckedListBox.Items
             ListEle.Selected = True
            ListEle.Checked = False
        Next

Anybody knows how to do this ? ? ? ?

The objective is to DESSELECT all THE Items on a CHECKEDLISTBOX...

Thanks !
0
franklinan
Asked:
franklinan
  • 2
1 Solution
 
PockyMasterCommented:
For Each index As Integer In CheckedListBox1.CheckedIndices
            CheckedListBox1.SetItemChecked(index, False)

        Next
0
 
franklinanAuthor Commented:
Thanks ! I'll give you the points, but....do you know how to do  a "for each " of ItemsCollection ? ? Looking for another past questions I've seen things like :

For each Li as listItem in Listbox
-.......

Next

But ListITem Does not exist !

0
 
PockyMasterCommented:
You can put whatever object into a listbox.

e.g. if you put strings inside

Iterate like:
For each s as String in ListBox1.Items

....

Next

e.g. if you put objects of class MyClass inside:

For each mc as MyClass in ListBox1.Items
...
Next

0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now