|
-
Sep 12th, 2000, 08:28 AM
#1
Thread Starter
Lively Member
Does anyone know how I can put a picture(bmp or ico) in the first column of a listview control not in the heading but where the actual data is placed? I am using the report style because I want headers. What I want to do is put a small foler in the first column. Which tells me that this is a folder and not just a regular file. So some rows will have a folder in the first column and some will not.
-
Sep 12th, 2000, 08:59 AM
#2
transcendental analytic
I haven't used listview for a while, and i don't have vb on this comp but to listview.listitems(item).Image should be set the key or index you have from a picture in a imagelist that must be connected to the listview.
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Sep 12th, 2000, 09:01 AM
#3
_______
<?>
you have to add an image list to your form
set it's properties for the ico you will use
then set a reference from your listview to the imagelist
ie.
'set the list ctrl icon properties
'
listview1.Icons = imagelist1
"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 12th, 2000, 09:26 AM
#4
Thread Starter
Lively Member
HeSaidJoe,
How do you add the icon to the first column after you do the listview1.Icons = imagelist1 statement? I did this and see no icon in the listview control. I added one image to the imagelist control.
-
Sep 12th, 2000, 10:18 AM
#5
transcendental analytic
as i said:
Code:
listview1.listitems(iteminlistview).Image= iteminimagelist
the items should be either specified as keys, or index, that depends if you have them with or without keys.
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Sep 12th, 2000, 11:44 AM
#6
_______
<?>
[code]
'Sorry, busy day
'in this example lvwAddresses is the listview
'ilsSmallIcons and slsLargeIcons are 2 imageboxes
'one for large one for small icons
Dim itmAddress as ListItem
'set the list ctrl icon properties
'this initializes the image list
lvwAddresses.Icons = ilsLargeIcons
lvwAddresses.SmallIcons = ilsSmallIcons
'
'add columnHeaders..the width of the columns is
'the widht of the ctrl / 2 by the num of headers
'
Set hdrAddresses = lvwAddresses.ColumnHeaders.Add(, , "Name")
'add some data to the listitem (itmAddress)
Set itmAddress = lvwAddresses.ListItems.Add(, , "Kim & Deb", 1, 1)
itmAddress.SubItems(1) = "944-444-4444"
itmAddress.SubItems(2) = "44 who knows 44"
'
'note
'to omitt the icons remove the 1,1 form the statement
Set itmAddress = lvwAddresses.ListItems.Add(, , "Phil & Tony")
itmAddress.SubItems(1) = "444-055-5555"
itmAddress.SubItems(2) = "55 who knows 55"
[code]
"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
|