Listview not working with my code (WHY)

If you need help with a project or need to know how to do something specific in VB.NET then please ask your questions in here.
Forum rules
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
3 posts Page 1 of 1
Contributors
User avatar
muttley1968
Hardcore Programmer
Hardcore Programmer
Posts: 622
Joined: Thu Jun 17, 2010 11:54 pm

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
User avatar
XTechVB
VIP - Site Partner
VIP - Site Partner
Posts: 727
Joined: Thu May 20, 2010 10:32 am

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
You can find me on Facebook or on Skype mihai_92b
User avatar
Scottie1972
Codenstuff Elite
Codenstuff Elite
Posts: 953
Joined: Thu Jan 14, 2010 5:48 am

there is nothing "simple" about using ListViews.
thats your first mistake.
Image
3 posts Page 1 of 1
Return to “Coding Help & Support”