' Determine if there are any items checked.
If CheckedListBox1.CheckedItems.Count <> 0 Then
' If so, loop through all checked items and print results.
Dim x As Integer
Dim s As String = ""
For x = 0 To CheckedListBox1.CheckedItems.Count - 1
s = s & "Checked Item " & (x + 1).ToString & " = " & CheckedListBox1.CheckedItems(x).ToString & ControlChars.CrLf
Next x
MessageBox.Show(s)
End If
// Determine if there are any items checked.
if(checkedListBox1.CheckedItems.Count != 0)
{
// If so, loop through all checked items and print results.
string s = "";
for(int x = 0; x <= checkedListBox1.CheckedItems.Count - 1 ; x++)
{
s = s + "Checked Item " + (x+1).ToString() + " = " + checkedListBox1.CheckedItems[x].ToString() + "\n";
}
MessageBox.Show (s);
}
// Determine if there are any items checked.
if ( checkedListBox1.get_CheckedItems().get_Count() != 0 )
{
// If so, loop through all checked items and print results.
System.String s = "";
for(int x=0;x <= checkedListBox1.get_CheckedItems().get_Count() - 1;x++)
{
s = s + "Checked Item " + Convert.ToString(++x) + " = " + checkedListBox1.get_CheckedItems().get_Item(x).ToString() + "\n";
}
MessageBox.Show(s);
}
// Determine if there are any items checked.
if(checkedListBox1->CheckedItems->Count != 0)
{
// If so, loop through all checked items and print results.
String ^ s = "";
for(int x = 0; x <= checkedListBox1->CheckedItems->Count - 1; x++)
{
s = String::Concat(s, "Checked Item ", (x+1).ToString(),
" = ", checkedListBox1->CheckedItems[x]->ToString(),
"\n");
}
MessageBox::Show(s);
}