• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 304
  • 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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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