C# : Looping forever foreach CheckedListBox item
<pre><code>foreach (CheckedListBox item in itemInfoCheckList.Items)
            {
                if (item.CheckState == CheckState.Checked)
                    SW.WriteLine(item.Text + " :  YES");
                else
                    SW.WriteLine(item.Text + " : NO");
            }
</code></pre>

<p>THe above code snippet is where  it loops ... although there are only 2 items
Below is the iteminfochecklist definition</p>

<pre><code> this.itemInfoCheckList.CheckOnClick = true;
        this.itemInfoCheckList.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
        this.itemInfoCheckList.FormattingEnabled = true;
        this.itemInfoCheckList.Items.AddRange(new object[] {
        "item 1 ",
        "item 2"});
        this.itemInfoCheckList.Location = new System.Drawing.Point(573, 350);
        this.itemInfoCheckList.Name = "itemInfoCheckList";
        this.itemInfoCheckList.Size = new System.Drawing.Size(197, 38);
        this.itemInfoCheckList.TabIndex = 143;
</code></pre>
