Kerala Microsoft Users Group

Checklistnox iteration

Latest post 05-12-2009 3:15 AM by Anuraj. 2 replies.
  • 05-12-2009 2:00 AM

    • Dinesh
    • Top 75 Contributor
      Male
    • Joined on 05-12-2009
    • Thiruvananthapuram
    • Newbie
    • Points 180

    Checklistnox iteration

    Hi guys,
    I'm working in a C# windows application where I'm using a checklistbox. Here is a situation in which I have to iterate thru the checkedlistbox to find a specific value within it.

    plz guys .. give me a solution for this....


    thanx in advance... :-)
    Filed under:
    • Post Points: 25
  • 05-12-2009 2:10 AM In reply to

    Re: Checklistnox iteration

    Did you try something like this? (example)

    For Each c In Me.Controls
     If TypeOf c Is LinkButton Then
      'c.Text = "Bla Bla"
     End If
    Next c

    Praveen V Nair, PMP
    Tech Blog | PM Blog

    • Post Points: 25
  • 05-12-2009 3:15 AM In reply to

    Re: Checklistnox iteration

    It will work I think

    foreach (string item in this.checkedListBox1.Items)
    {
    if(item == "myitem") { MessageBox.Show(item); }
    }

    Thanks

    Anuraj P
    http://www.dotnetthoughts.net

    THIS POSTING IS PROVIDED "AS IS" WITH NO WARRANTIES, AND CONFERS NO RIGHTS.
    BEWARE OF BUGS IN THE ABOVE CODE; I HAVE ONLY PROVED IT CORRECT, NOT TRIED IT.

    • Post Points: 5
Page 1 of 1 (3 items) | RSS