#91247 - 2003-01-28 11:23 PM
Re: putting an icon into a listview
|
Shawn
Administrator
   
Registered: 1999-08-13
Posts: 8611
|
Rad,Joe
Yup you got it ... in order for a ListView to display images, it needs an ImageList plugged into it and there are two properties provided just for this purpose:
$ListView.SmallImageList $ListView.LargeImageList
You can handjob the ImageList (like above) or you can pluggin an existing ImageList. Coincidentally enough the ICON LIBRARY is implemented as a SmallImageList and is referenced through the FORM object. So you can snap the builtin icon library into the ListView like this:
$ListView.SmallImageList = $Form.SmallImageList
Once the ImageList is plugged in, you can set an Item to display an icon in two ways. Once when its first created:
$Item = $ListView.Items.Add("john",23)
or afterwards using the ImageIndex (Index into ImageList) property:
$ListView.Items(0).ImageIndex = 24
Hope this helps.
-Shawn
|
|
Top
|
|
|
|
Moderator: Shawn, ShaneEP, Ruud van Velsen, Arend_, Jochen, Radimus, Glenn Barnas, Allen, Mart
|
0 registered
and 2554 anonymous users online.
|
|
|