日期:2014-05-19  浏览次数:20696 次

求救checkedlistbox取值出错
代码如下:
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();
也会出现相同的错误。

请问是什么原因,该如何解决?


------解决方案--------------------
测试了没有发现你说的问题
能不能贴出能模拟出问题的代码。。。