Results 1 to 2 of 2

Thread: textbox to listview

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2005
    Posts
    305

    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..

  2. #2
    Addicted Member Lectere's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    222

    Post 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:
    1. dim Lvi as listviewitem
    2. dim Lines() as string
    3.  
    4. lines = textbox1.text.split(chr(13))
    5.  
    6. listview1.items.clear
    7. listview1.beginupdate
    8. for c as integer = 0 to lines.count step 3
    9.  
    10.    lvi = listview1.items.add(lines(c))
    11.    lvi.subitems.add(lines(c+1))
    12.    lvi.subitems.add(lines(c+2))
    13.  
    14.  
    15. next
    16. 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
  •  



Click Here to Expand Forum to Full Width