Closed Thread
Results 1 to 3 of 3

Thread: Listview problems

  1. #1
    wygz is offline Newbie
    Join Date
    Jan 2008
    Posts
    6
    Rep Power
    0

    Listview problems

    Pls help me with my problem with this code. I have 2 textbox in my form, named list1 & list2, and i have one button. I want it that every time I click the button the value of list1 & list2 will appear in listview. The problem with this code is it come up with an errow "SUBSCRIPT OUT OF RANGE".

    Private Sub child_add_Click()
    Dim x(1 To 50)

    list.View = lvwReport
    list.ColumnHeaders.Add , , "Name:"
    list.ColumnHeaders.Add , , "Birthdate:"
    With list
    For i = 1 To UBound(x)
    .ListItems(i).ListSubItems.Add i, , x(i)
    Next
    End With

    End Sub
    Last edited by TcM; 02-08-2008 at 07:06 AM. Reason: !!!!Code Tags!!!!

  2. CODECALL Circuit advertisement
    Join Date
    Always
    Posts
    Many

     
  3. #2
    Join Date
    Aug 2006
    Posts
    11,209
    Blog Entries
    6
    Rep Power
    101
    I tried this code in VB 6.0, but it seems like VB.NET?

    and please use the code tags!

  4. #3
    jireh is offline Newbie
    Join Date
    Jan 2008
    Posts
    18
    Rep Power
    15
    Why did you use an array?
    Do you mean this...
    Code:
    Dim lview as ListItem
    
    list.View = lvwReport
    list.ColumnHeaders.Add , , "Name:"
    list.ColumnHeaders.Add , , "Birthdate:"
    With list
          Set lview = .ListItems.Add(,,,list1.Text)
          lview.Subitems(1)=list2.text
    end with
    set lview=nothing

    regards,

    jireh

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Listview Help?????
    By jbnonn in forum C# Programming
    Replies: 3
    Last Post: 01-30-2011, 02:17 PM
  2. can fix it about listview
    By kiddies in forum Visual Basic Programming
    Replies: 2
    Last Post: 06-22-2010, 03:57 AM
  3. Help Using Listview
    By edge02 in forum Visual Basic Programming
    Replies: 2
    Last Post: 04-04-2010, 12:58 AM
  4. listview
    By Siten0308 in forum C# Programming
    Replies: 13
    Last Post: 12-12-2008, 09:14 AM
  5. ListView Help?
    By MXTECH in forum Visual Basic Programming
    Replies: 3
    Last Post: 11-17-2008, 12:25 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts