62,269
社区成员
发帖
与我相关
我的任务
分享
一个listbox控件 里面的数据是动态的
比如里面有数据
aa
bb
cc
dd
小弟的要求是 点击一个按钮 把这个控件的数据全部成表示成
aa,bb,cc,dd
然后显示在textbox控件上
listbox的数据不用选中 就是把这个控件的数据全部都显示出来 数据是动态的
谢谢大家乐
string str = "";
for (int i = 0; i < lb.Items.Count; i++)
{
str += lb.Items[i].Text + ",";
}
if (str.Length > 1)
{
str = str.Substring(0, str.Length - 1);
}
this.TextBox1.Text = str;