列表框项目到文本框 [英] listbox item to text box

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

问题描述

我想把列表框项目放在这样的文本框中



listbox

1

3

5

7

10



到此...





textbox

1-3-5-7-10



其vb.net。



谢谢你,

解决方案

 对于 i =  0   ListBox1.Items.Count  -   1  
textbox1.Text = textbox1.Text& - & ListBox1.Items(i).ToString
Next
textbox1.Text = textbox1.Text.Substring( 1 )< pre lang = vb>


使用此代码,您将获得问题的解决方案..



 对于 i 作为 整数 =  0    ListBox1.Items.Count  -   1  
TextBox1.Text = TextBox1.Text + - + ListBox1.Items(i).Text
Next
TextBox1.Text = TextBox1.Text.Substring( 1







谢谢

AARIF


i want to put the list box items in textbox like this

listbox
1
3
5
7
10

to this...


textbox
1-3-5-7-10

its vb.net.

thank you,

解决方案

For i = 0 To ListBox1.Items.Count - 1
    textbox1.Text = textbox1.Text & "-" & ListBox1.Items(i).ToString
Next
textbox1.Text = textbox1.Text.Substring(1)<pre lang="vb">


Use this Code , Defiantly you will get solution of your Problem..

For i As Integer = 0 To ListBox1.Items.Count - 1
	TextBox1.Text = TextBox1.Text + "-" + ListBox1.Items(i).Text
Next
TextBox1.Text = TextBox1.Text.Substring(1)




Thanks
AARIF


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

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