|
-
Nov 5th, 2007, 12:53 PM
#1
Thread Starter
Frenzied Member
[RESOLVED] Make new items in Listview bold
Hi, I have a problem with checking a Listview for new items. I think it should be quite easy, but I can't figure it out.
The data in my Listview gets updated from an online XML file (RSS feed). After the data has been added to the Listview, all items are added to a Collection as well.
When the data is updated again, I want to loop through the Listview items and check if an item also exists in the Collection (which consists of data from the previous update). If the Listview item cannot be found in the Collection it means it's new data and I want to make it bold.
I can't simply count Listview items, because most of the time the updated data is partially the same.
vb Code:
If cItems.Count <> 0 Then
For i = 1 To lvwXML.ListItems.Count 'Loop through Listview
tmp = lvwXML.ListItems(i).Text 'Put item in a variable
For y = 1 To cItems.Count 'Loop through the Collection
'// If Listview item is not in the Collection it's new data
If tmp ????? Then
lvwXML.ListItems(i).Bold = True
End If
Next y
Next i
End If
Set cItems = Nothing
Set cItems = New Collection
For i = 1 To lvwXML.ListItems.Count
cItems.Add lvwXML.ListItems(i).Text 'Store current Listview data in Collection again to use with the next update
Next i
-
Nov 5th, 2007, 01:12 PM
#2
Re: Make new items in Listview bold
dont "recheck"
where are you adding the items to the listview?
when you add it.. its a new item.. make it bold then
JPnyc rocks!! (Just ask him!)
If u have your answer please go to the thread tools and click "Mark Thread Resolved"
-
Nov 5th, 2007, 01:58 PM
#3
Thread Starter
Frenzied Member
Re: Make new items in Listview bold
::Edit::
Nevermind, I found the problem.
There was something wrong with adding the data.
Last edited by Chris001; Nov 5th, 2007 at 02:04 PM.
-
Nov 5th, 2007, 02:06 PM
#4
Re: [RESOLVED] Make new items in Listview bold
ok, im rusty with collections... but what if you compare
If tmpSubject = CStr(cItems(i)) Then
to make sure its a string to string compare?
JPnyc rocks!! (Just ask him!)
If u have your answer please go to the thread tools and click "Mark Thread Resolved"
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
|