-
Jan 16th, 2012, 11:00 PM
#1
Thread Starter
Hyperactive Member
textbox to listview
i have a textbox with text in a few lines..
i want that to be organized in a listview as an item and 2 subitems...
if there's a 4th line then it should again go as a new item.. how can i do that..
-
Jan 17th, 2012, 10:05 AM
#2
Addicted Member
Re: textbox to listview
I just typed this out of my head, so it might contain some syntax errors, but in rough lines, this should be it...
In the GUI make sure the listview is in detailed mode, and that it has 3 column headers...
vb.net Code:
dim Lvi as listviewitem
dim Lines() as string
lines = textbox1.text.split(chr(13))
listview1.items.clear
listview1.beginupdate
for c as integer = 0 to lines.count step 3
lvi = listview1.items.add(lines(c))
lvi.subitems.add(lines(c+1))
lvi.subitems.add(lines(c+2))
next
listview1.endupdate
Last edited by Hack; Jan 17th, 2012 at 12:17 PM.
Reason: Last edited by Lectere; Today at 10:10 AM Added Highlight Tags
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|