关于ListBox的问题!? 问题是这样的,我把ListBox的SelectedMode设置成了多选,即Multiple。但是我在使用ListBox的SelectedValue这个属性的时候,不能获取我多选后的结果,这是为什么!? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 你可以通过SelectedItems或者SelectedIndices来进行访问。 string str; for(int i=0;i<ListBox1.Items.Count;i++) { if(ListBox1.Items[i].Selected==true) { str+=ListBox1.Items[i].Value+","; } }str为多选的值 string aa="";for(int m=0;m<this.listBox1.SelectedItems.Count;m++){ aa =aa + this.listBox1.SelectedItems[m].ToString();} 100分求c#库存管理系统,先进先出算法示例 如何快速添加合并Table? 菜鸟请教字符串截取 还有前途吗? c#存储过程的问题 关于在 .net 程序中启动另外一个程序的问题~ datagrid的排序问题 高手帮忙,看看可不可以优化 急!!c#安装制作问题(应用程序快捷方式) 再线求救! 连接数据库的问题 我用这个读写INI文件,怎么会有这个问题?
for(int i=0;i<ListBox1.Items.Count;i++)
{
if(ListBox1.Items[i].Selected==true)
{
str+=ListBox1.Items[i].Value+",";
}
}
str为多选的值
for(int m=0;m<this.listBox1.SelectedItems.Count;m++)
{
aa =aa + this.listBox1.SelectedItems[m].ToString();
}