关于checkedlistbox问题 如何把checkedlistbox中每一个复选的项用空格隔开存到stirng里 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 StringBuilder tempString = new StringBuilder();for(int i=cbl.SelectedIndex;i<cbl.Items.Count;i++){ if(cbl.Item[i].Selected) { tempString.Append(cbl.Item{i].Value);//还是要Text? tempString.Append(" "); }}return tempString.ToString().Trim(); for (int i = 0; i < checkedListBox1.Items.Count; i++ ) {//如果这一项被选中 if (checkedListBox1.GetItemChecked(i) == true) { MessageBox.Show(checkedListBox1.Items[i].ToString()); } } private void button1_Click(object sender, EventArgs e) { string msg = ""; foreach (string str in this.checkedListBox1.CheckedItems) { msg += str + ",";//用“,”号隔开 累加成字符串 } if (msg == "") MessageBox.Show("no box is checked!"); else { msg += "are checked and" + this.checkedListBox1.SelectedItem.ToString() + "is selected"; MessageBox.Show(msg); } } 这个好像不对啊,我是想要把checkedlistbox里打勾的每一项的text用空格隔开存到string里 C# 实现 checkedListBox单选(多种方法) 谢谢,搞定了,帮忙看下另外的问题吧http://topic.csdn.net/u/20110415/14/b7882f60-15d2-435a-880e-c567ada0dc8a.html C#图像处理相关问题 列读取的问题,大家帮帮忙? 迄今没找到:c#到底有没有办法把多个textbox的值利用循环赋给数组? C#写的一个递归,好像没有错不知道为什么说我堆栈溢出,请高手进来帮个忙 DataGridView横向滚动的问题 Web应用程序发布后Process.Start()报出异常. 求一个正则表达式。关于抓取新闻的。 多数据库连接操作问题 C# 读取xml到dataset 我想在IE中实现像在线杀毒那样功能的开发技术是什么?DCOM? 加分!!!!C# 树形结构相关问题 !! c# 树形结构在树形结构
for(int i=cbl.SelectedIndex;i<cbl.Items.Count;i++)
{
if(cbl.Item[i].Selected)
{
tempString.Append(cbl.Item{i].Value);//还是要Text?
tempString.Append(" ");
}
}return tempString.ToString().Trim();
{
//如果这一项被选中
if (checkedListBox1.GetItemChecked(i) == true)
{
MessageBox.Show(checkedListBox1.Items[i].ToString());
}
}
private void button1_Click(object sender, EventArgs e)
{
string msg = "";
foreach (string str in this.checkedListBox1.CheckedItems)
{
msg += str + ",";//用“,”号隔开 累加成字符串
}
if (msg == "")
MessageBox.Show("no box is checked!");
else
{
msg += "are checked and" + this.checkedListBox1.SelectedItem.ToString() + "is selected";
MessageBox.Show(msg);
}
}
http://topic.csdn.net/u/20110415/14/b7882f60-15d2-435a-880e-c567ada0dc8a.html