Reputation: 312
I wante to do something like this.
String s = "";
foreach (var item in checkedListBox1.Items)
{
s = checkedListBox1.Items(item).tostring;
// do something with the string
}
I want to have the string
of the item which is in the list box.
How can I get it runnig?
Upvotes: 2
Views: 1658
Reputation: 2476
I haven't try it yet but I think this should work.
string s = "";
foreach (var item in checkedListBox1.Items)
{
s = item.ToString();
// do something with the string
}
Upvotes: 1
Reputation: 3114
I believe what you are looking for is this:
foreach (var item in checkedListBox1.Items)
{
checkedListBox1.GetItemText(item);
}
Probably not the most useful, but here is the MSDN for it.
Upvotes: 0
Reputation: 5423
string s = "";
foreach (string item in checkedListBox1.Items)
{
s = item;
// do something with the string
}
Upvotes: 0