如何将列表框项目放在文本框中
问题描述:
我想将列表框项目放在文本框中
listbox
1
2
3
4
5
6
7
到这个...
textbox >
1-2-3-4-5-6-7
其vb.net。
谢谢你,
i want to put the list box items in textbox
listbox
1
2
3
4
5
6
7
to this...
textbox
1-2-3-4-5-6-7
its vb.net.
thank you,
答
你能解释想做什么吗?
你没有提供你的代码。
我正在编写示例代码,你可以这样实现你的要求:
You didn't provide your code.
I am writing sample code, You can achieve your requirement like this way:
txtalp.Text = "22"
Dim x As String = ""
For k As Integer = 1 To (Convert.ToInt32(textBox1.Text))
listBox2.Items.Add(k)
Next
For i As Integer = 0 To listBox2.Items.Count - 1
x += "-" + listBox2.Items(i)
Next
x = x.Remove(0, 1)
textBox1.Text = x