如何将文本框文本放在列表框中 [英] How Can I Put The Textbox Text In The Listbox
本文介绍了如何将文本框文本放在列表框中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想将文本框号码放在列表框中。
testbox2
1-4-5-7-9
到此....
listbox2
1
4
5
7
9
i希望你能帮帮我
谢谢你,
解决方案
< pre lang =vb> Dim str As String = TextBox.Text;
Dim arr As String ()= str.Split( New Char (){ - })
Dim i 作为 整数
对于 i = 0 arr.Length - 1
ListBox1.Items.Add(arr(i))
Next i
i wanted to put the textbox number in the listbox like this.
testbox2
1-4-5-7-9
to this....
listbox2
1
4
5
7
9
i hope you can help me
thank you,
解决方案
Dim str As String = TextBox.Text; Dim arr As String() = str.Split(New Char() {"-"}) Dim i As Integer For i = 0 To arr.Length - 1 ListBox1.Items.Add(arr(i)) Next i
这篇关于如何将文本框文本放在列表框中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文