如何将列表框项目放在文本框中 [英] How Do I Put The Listbox Items In Textbox

查看:106
本文介绍了如何将列表框项目放在文本框中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将列表框项目放在文本框中



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


这篇关于如何将列表框项目放在文本框中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆