Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27514

VS 2010 listview - add items

$
0
0
Hi

i have 3 columns in my listview and want to populate them from a txt file and ordered by "install order" which is by no.....

here's what i have:
Code:

Public Class SelectPrograms

    Dim Ver As String = " - v1.0.1 Beta 2"
    Dim file_name As String = Application.StartupPath + "/Start/InstallCFG.ini"
    Dim stream_reader As New IO.StreamReader(file_name)
    Dim ReadResult() As String
    Dim line As String

    Private Sub SelectPrograms_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Me.Show()
        Me.Text = "Post Install By Chris2k" + Ver

        line = stream_reader.ReadLine() 'Read InstallCFG.ini File

        Do While stream_reader.Peek <> -1
            ReadResult = line.Split(":") 'Split line at :
            Dim App As New ListViewItem

            App.SubItems.Add("item #2")
            App.SubItems.Add("item #3")

            ListView1.Items.Add(App)

            'If (ReadResult(0).ToLower() = "prog name") Then
            '    App.SubItems.Add(ReadResult(1))
            'End If

            'If (ReadResult(0).ToLower() = "description") Then
            '    App.SubItems.Add("Desc of program")
            'End If
        Loop
    End Sub

    Private Sub ListView1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListView1.SelectedIndexChanged

    End Sub
End Class


Viewing all articles
Browse latest Browse all 27514

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>