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

Posted on 2006-04-09
Last Modified: 2008-01-09
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

Anybody knows how to do this ? ? ? ?

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

Thanks !
Question by:franklinan
    LVL 14

    Accepted Solution

    For Each index As Integer In CheckedListBox1.CheckedIndices
                CheckedListBox1.SetItemChecked(index, False)

    LVL 1

    Author Comment

    Thanks ! I'll give you the points, 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


    But ListITem Does not exist !

    LVL 14

    Expert Comment

    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



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

    For each mc as MyClass in ListBox1.Items


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
    It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
    This video is in connection to the article "The case of a missing mobile phone (". It will help one to understand clearly the steps to track a lost android phone.
    Internet Business Fax to Email Made Easy - With eFax Corporate (, you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now