|
-
Oct 8th, 2005, 06:06 PM
#1
Thread Starter
PowerPoster
ListView Subitems
In other apps where I've used the ListView i've added things like this.
VB Code:
Dim itmX as ListView
Set itmX = ListView1.ListItems.Add
itmX = Item1
itmX.SubItems(1) = Item2
itmX.SubItems(2) = Item3
'etc....
However in a new app i've set everything up the same but when I try to complie to EXE i get a message saying "Method or data member not found" and the below code is highlighted. I can't figure out why it's not working
Last edited by lintz; Oct 8th, 2005 at 06:36 PM.
-
Oct 8th, 2005, 06:16 PM
#2
Re: ListView Subitems
VB Code:
ListView1.ListItems.Add , , "Some text"
ListView1.ListItems.Item(ListView1.ListItems.Count).ListSubItems.Add , , "Subitem 1 text"
ListView1.ListItems.Item(ListView1.ListItems.Count).ListSubItems.Add , , "Subitem 2 text"
ListView1.ListItems.Item(ListView1.ListItems.Count).ListSubItems.Add , , "Subitem 3 text"
-
Oct 8th, 2005, 06:22 PM
#3
Thread Starter
PowerPoster
Re: ListView Subitems
Thanks baja_yu, but can you explain why my code won't work "this time"?
-
Oct 8th, 2005, 06:33 PM
#4
Re: ListView Subitems
You have wrong declaration: instead of declaring As Listview you should have it As ListItem:
VB Code:
Dim itm As [b]ListItem[/b]
-
Oct 8th, 2005, 06:36 PM
#5
Thread Starter
PowerPoster
Re: ListView Subitems
Thanks Rhino, that was my problem.....a little early on a Sunday to be coding
-
Oct 8th, 2005, 07:04 PM
#6
Re: ListView Subitems
It happends ...
-
May 28th, 2012, 06:02 AM
#7
New Member
Re: ListView Subitems
Hi i have a problem populating the Listview in VB.net, it doesn;t actually display the rows from a table (like it does in VB6)
vb Code:
Dim da As New System.Data.OleDb.OleDbDataAdapter()
Dim ds As New DataSet()
da.Fill(ds, rstTemp, "customers")
'
Dim iTM As ListViewItem
For i = 0 To ds.Tables(0).Rows.Count - 1
iTM = ListView1.Items.Add(ds.Tables(0).Rows(i).Item(0))
iTM.SubItems(1) = ds.Tables(0).Rows(i).Item(1)
Next
the customers table contains fields, CUSTNO, LNAME, FNAME but when you run the above code it doesn't show the proper listing of rows from customers table, a little help would be appreciated. Thanks.
-
May 28th, 2012, 03:14 PM
#8
Re: ListView Subitems
Holy Moly, 14,465 views and only 7 replies.
Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.
-
May 28th, 2012, 03:37 PM
#9
Re: ListView Subitems
jmsrickland, this thread is 6,5 years old 
@gdcats, you should start your own thread in the VB.NET forum instead of digging up a 6,5 year old thread in the VB6 forum.
-
May 28th, 2012, 03:52 PM
#10
Re: ListView Subitems
Maybe that explains why so many views. I hardly ever look at the date of the Thread. If I see it in the Forum I go into it without any care whatsoever as to it's age
Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|