首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > C# >

求救checkedlistbox取值出错解决方法

2012-01-06 
求救checkedlistbox取值出错代码如下:for(inti0i checkedListBoxModel.CheckedItems.Counti++){string

求救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();
也会出现相同的错误。

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


[解决办法]
测试了没有发现你说的问题
能不能贴出能模拟出问题的代码。。。

热点排行