代码如下:
for(int i=0; i<checkedListBoxModel.CheckedItems.Count;i++)
{
string strCheckedFilterModel = checkedListBoxModel.CheckedItems[i].ToString();
}跟踪strFilterModel的值,发现报错:
error: identifier 'strCheckedFilterModel' out of scope 同时使用
checkedListBoxModel.GetItemText(checkedListBoxModel.CheckedItems[i]).ToString();
也会出现相同的错误。请问是什么原因,该如何解决?