Page 1 of 1

Listview not working with my code (WHY)

Posted: Wed Jun 12, 2013 4:59 pm
by muttley1968
hi im making a program and it uses a simple list view I have it half working basically it adds the subitem but not the
main item which is most important here is my code
Code: Select all
    Private Sub BackTrackButton9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BackTrackButton9.Click
        Dim lvi As New ListViewItem
        lvi.Text = (BackTrackTextBox6.Text)
        lvi.SubItems.Add(BackTrackTextBox8.Text)
        BackTrackListView1.Items.Add(lvi)
    End Sub

PLEASE tell me you know how to fix it someone :P

Re: Listview not working with my code (WHY)

Posted: Wed Jun 12, 2013 6:02 pm
by XTechVB
this code works for me
Code: Select all
Dim lvi As New ListViewItem(BackTrackTextBox6.Text)
        lvi.SubItems.Add(BackTrackTextBox8.Text)
        BackTrackListView1.Items.Add(lvi)
Image

Re: Listview not working with my code (WHY)

Posted: Thu Jun 13, 2013 5:12 am
by Scottie1972
there is nothing "simple" about using ListViews.
thats your first mistake.