#91242 - 2003-01-28 09:04 PM
putting an icon into a listview
|
Radimus
Moderator
   
Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
|
|
|
Top
|
|
|
|
#91245 - 2003-01-28 10:20 PM
Re: putting an icon into a listview
|
Radimus
Moderator
   
Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
|
I'm looking to put icons into column 1 of this:
probably the red X, green check, ?, and the NOT symbol
for service not exist, service exists, can't connect, and no permissions
|
|
Top
|
|
|
|
#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
|
|
|
|
#91248 - 2003-01-28 11:26 PM
Re: putting an icon into a listview
|
Radimus
Moderator
   
Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
|
I got as far as imageindex... :-)
and it always helps...
|
|
Top
|
|
|
|
#91251 - 2003-01-28 11:41 PM
Re: putting an icon into a listview
|
Radimus
Moderator
   
Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
|
got it... updated picture.
|
|
Top
|
|
|
|
Moderator: Shawn, ShaneEP, Ruud van Velsen, Arend_, Jochen, Radimus, Glenn Barnas, Allen, Mart
|
0 registered
and 6124 anonymous users online.
|
|
|