Results 1 to 5 of 5
  1. #1
    AeroMan's Avatar
    Join Date
    Dec 2008
    Gender
    male
    Location
    Hell
    Posts
    3,294
    Reputation
    189
    Thanks
    3,049
    My Mood
    Busy

    Exclamation [Help] Groups,Columns,Listview[Solved]

    Hey,
    i never used to use Listviews, But im making a "WeightWatcher" for my grandmother.

    Does anyone knows how i can add items by a button to the next groups?


    Credits on release to the guy who helped me
    Thanks

  2. #2
    Shark23's Avatar
    Join Date
    Mar 2010
    Gender
    male
    Location
    Kansas
    Posts
    424
    Reputation
    10
    Thanks
    55
    My Mood
    Cool
    What do you mean?
    Assembly Programmer

  3. #3
    Blubb1337's Avatar
    Join Date
    Sep 2009
    Gender
    male
    Location
    Germany
    Posts
    5,915
    Reputation
    161
    Thanks
    3,108
    [php]Listview1.items.add("item")
    listview1.items(listview1.items.count - 1).subitems.add("bla") 'first subitem
    listview1.items(listview1.items.count - 1).subitems.add("bla") 'second subitem
    listview1.items(listview1.items.count - 1).subitems.add("bla") 'third subitem[/php]

    [php]Msgbox(Listview1.selecteditems(0).subitems(0).text ) 'main item
    Msgbox(listview1.selecteditems(0).subitems(1).text ) 'first subitem[/php]

    [php] Private Sub SaveListViewContent(ByVal ltv As ListView, ByVal filename As String, ByVal colDelimeter As Char)
    Dim sb As New System.Text.StringBuilder

    For Each itm As ListViewItem In ltv.Items
    Dim colsOfLine As New List(Of String)
    For Each colItm As ListViewItem.ListViewSubItem In itm.SubItems
    colsOfLine.Add(colItm.Text)
    Next
    sb.AppendLine(String.Join(colDelimeter, colsOfLine.ToArray))
    Next

    IO.File.WriteAllText(filename, sb.ToString)
    End Sub

    Private Sub LoadToListView(ByVal filename As String, ByVal ltv As ListView, ByVal colDelimeter As Char)
    If Not IO.File.Exists(filename) Then Throw New IO.FileNotFoundException
    For Each line As String In IO.File.ReadAllLines(filename)
    Dim colsOfLine() As String = line.Split(colDelimeter)
    While colsOfLine.Length > ltv.Columns.Count
    ltv.Columns.Add("Column " & ltv.Columns.Count)
    End While
    ltv.Items.Add(New ListViewItem(colsOfLine))
    Next
    End Sub[/php]
    Last edited by Blubb1337; 07-22-2010 at 09:48 AM.



  4. The Following User Says Thank You to Blubb1337 For This Useful Post:

    AeroMan (07-22-2010)

  5. #4
    Threadstarter
    Upcoming MPGHiean
    AeroMan's Avatar
    Join Date
    Dec 2008
    Gender
    male
    Location
    Hell
    Posts
    3,294
    Reputation
    189
    Thanks
    3,049
    My Mood
    Busy
    Thanks,Working perfectly

  6. #5
    Lolland's Avatar
    Join Date
    Feb 2009
    Gender
    male
    Location
    Lolland!
    Posts
    3,156
    Reputation
    49
    Thanks
    868
    My Mood
    Inspired
    Marked solved, don't post within 7 days unless completely necessary.

Similar Threads

  1. [Help]Saving ListView[Solved]
    By Lyoto Machida in forum Visual Basic Programming
    Replies: 19
    Last Post: 02-11-2011, 08:33 PM
  2. [Help]Splitting data into a ListView[Solved]
    By cosconub in forum Visual Basic Programming
    Replies: 3
    Last Post: 02-09-2011, 09:39 PM
  3. [Help]Listview[Solved]
    By Blubb1337 in forum Visual Basic Programming
    Replies: 19
    Last Post: 03-31-2010, 03:53 PM
  4. [Help]Proxy With WebBrowser[Solved]
    By ppl2pass in forum Visual Basic Programming
    Replies: 1
    Last Post: 03-07-2010, 11:03 PM
  5. [Help]Basic Text Box[Solved]
    By FlashDrive in forum Visual Basic Programming
    Replies: 3
    Last Post: 03-06-2010, 10:54 PM