0
Dim a As Integer
    While a < CheckedListBox1.CheckedItems.Count - 1

        a = a + 1
    End While

It crashes at: WordBankArray(a) = CheckedListBox1.CheckedItems(a)

Ňɏssa Pøngjǣrdenlarp
  • 38,411
  • 12
  • 59
  • 178

1 Answers1

0
a=0;

foreach (ListItem li in CheckedListBox1.Items)
{
    a=a+1
    if (li.Selected)
    {
        WorkBankArray(a) = CheckedListBox1.Items[a].ToString();
    }
}

you can adjust the code as per your situation this is the broader guideline.

Mubeen
  • 11
  • 4