|
-
Sep 17th, 2000, 08:36 AM
#1
Thread Starter
_______
Code:
'question:
'I load my listview and I use 2 different icons
'one for odd numbers, one for even. No Problem
'
I can then view my listview by LargeIcon,SmallIcon,List,Report
No Problem
However, when viewing largeicon I only get one icon
All the rest show me the 2 different icons.
There obviously is a reason...someone what to impart
that bit of knowledge on me.
'load an array with information
Dim myArr(99)
Dim i As Integer
For i = 1 To 99
myArr(i) = CInt(Rnd * 99)
Next i
'then load the array into a listview
Dim x As Variant 'differ between odd and even rows
For i = 1 To 99
'used different images every second line
'image one for odd, image2 for even
x = i / 2
If x Like "*.*" Then
Set sItem = Listview1.ListItems.Add(, , myArr(i), 1, 1)
Else
Set sItem = Listview1.ListItems.Add(, , myArr(i), 1, 2)
End If
'add subitems
sItem.SubItems(1) = "905-444-9455"
sItem.SubItems(2) = "who knows"
Next i
"A myth is not the succession of individual images,
but an integerated meaningful entity,
reflecting a distinct aspect of the real world."
___ Adolf Jensen
-
Sep 17th, 2000, 09:48 AM
#2
Fanatic Member
I think you are going to kick yourself.
This line is the problem
Code:
'you have 1 as the image for the nromal icon
Set sItem = Listview1.ListItems.Add(, , myArr(i), 1, 2)
'it should be 2
Set sItem = Listview1.ListItems.Add(, , myArr(i), 2, 2)
I would also suggest you use the MOD operator to determine odd / even numbers
Code:
If i Mod 2 <> 0 Then
Set sItem = ListView1.ListItems.Add(, , myArr(i), 1, 1)
Else
Set sItem = ListView1.ListItems.Add(, , myArr(i), 2, 2)
End If
Iain, thats with an i by the way!
-
Sep 17th, 2000, 10:04 AM
#3
Thread Starter
_______
<?>
KICK KICK
one for the line, one for mod
I knew there was an operator I just didn't know which one
and I was too embarassed to ask and then I go and paste my code...make that KICK KICK KICK
Thanks,
Later
"A myth is not the succession of individual images,
but an integerated meaningful entity,
reflecting a distinct aspect of the real world."
___ Adolf Jensen
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
|