开发者

(VB .Net) Parsing Listbox entries into Textboxes with comma delimiters

开发者 https://www.devze.com 2023-04-12 05:41 出处:网络
Just what the title says. I have a listbox with varied entries, all in one format: name, email, phone, age

Just what the title says. I have a listbox with varied entries, all in one format:

name, email, phone, age

When an entry is selected, and when a certain button is clicked, I require the entry to be removed from the listbox and the four 开发者_Go百科categories from the entry must each go into their assigned textboxes.

Could someone please help me with this?


Use Split. Try something like this, with "value" as the selected listbox text.

Dim parts As String = value.Split (",")
Dim name As String = Trim(parts (0))
Dim email As String = Trim(parts (1))
Dim phone As String = Trim(parts (2))
Dim age As String = Trim(parts (3))
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号