2

我想做这样的事情。

String s = "";
foreach (var item in checkedListBox1.Items)
{
        s = checkedListBox1.Items(item).tostring;
         // do something with the string
}

我想要string列表框中的项目。

我怎样才能让它运行起来?

4

3 回答 3

1

我还没有尝试过,但我认为这应该可行。

string s = "";
foreach (var item in checkedListBox1.Items)
{
        s = item.ToString();
         // do something with the string
}
于 2013-03-09T15:21:20.313 回答
0
string  s = "";
foreach (string item in checkedListBox1.Items)
{
   s = item;
   // do something with the string

}
于 2013-03-09T15:18:01.093 回答
0

我相信您正在寻找的是:

foreach (var item in checkedListBox1.Items)
{
    checkedListBox1.GetItemText(item);
}

可能不是最有用的,但这里是它的 MSDN。

于 2013-03-09T15:19:19.773 回答