[英]How Do I Append Items to a Listbox in Another Window Whenever I Click a Button in C#?
[英]How Do I Transfer Listbox Items Into A Textbox By Clicking A Button C#
我有一个列表框,其中的所有项目均已汇总。
我希望通过单击按钮将列表框中的所有项目转移到文本框中。
并且每个项目必须由字符#分隔
提前致谢。
string str1 = "";
foreach(var k in listBox1.Items)
{
str1 = str1 + " #" + k;
}
textBox1.Text = str1;
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.