2013-03-09 40 views

回答

1

我還沒試試,但我認爲這應該工作。

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

我只是在我的測試中忘記了()...對不起 – tux007 2013-03-09 15:26:36

0
string s = ""; 
foreach (string item in checkedListBox1.Items) 
{ 
    s = item; 
    // do something with the string 

} 
0

我相信你正在尋找的是這樣的:

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

也許不是最有用的,但here is the MSDN它。