Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > PowerShell

Vista - ListView + ImageList

Reply
 
Old 08-10-2007   #1 (permalink)
Selko


 
 

ListView + ImageList

Hi,

I just created a list view:
$listview= new-object System.Windows.Forms.ListView
$listview.DropDownStyle="DropDownList"
....
and i have added Items

My question is how can i add an an image (icon) in each row
With an ImageList??

Could you help me to solve my problem

My System SpecsSystem Spec
Old 08-14-2007   #2 (permalink)
Selko


 
 

RE: ListView + ImageList

hey group,

nobody can help me?

"Selko" wrote:

> Hi,
>
> I just created a list view:
> $listview= new-object System.Windows.Forms.ListView
> $listview.DropDownStyle="DropDownList"
> ...
> and i have added Items
>
> My question is how can i add an an image (icon) in each row
> With an ImageList??
>
> Could you help me to solve my problem

My System SpecsSystem Spec
Old 08-14-2007   #3 (permalink)
Jeff


 
 

Re: ListView + ImageList

On Aug 14, 5:30 pm, Selko <Se...@discussions.microsoft.com> wrote:
> hey group,
>
> nobody can help me?
>
> "Selko" wrote:
> > Hi,

>
> > I just created a list view:
> > $listview= new-object System.Windows.Forms.ListView
> > $listview.DropDownStyle="DropDownList"
> > ...
> > and i have added Items

>
> > My question is how can i add an an image (icon) in each row
> > With an ImageList??

>
> > Could you help me to solve my problem


The MSDN documentation for the ListView class has a complete example:

http://msdn2.microsoft.com/en-us/lib....listview.aspx

Good luck.

Jeff

My System SpecsSystem Spec
Old 08-15-2007   #4 (permalink)
Selko


 
 

Re: ListView + ImageList

ok thanks

here is my solution

$bitm=[Drawing.Image]::FromFile("pathtoimg.bmp")
$imageListSmall = new-Object System.Windows.Forms.ImageList
$imageListSmall.Images.Add($bitm)
#ListView
$lv.SmallImageList = $imageListSmall;
$lv.Items.Add("Test",0)

"Jeff" wrote:

> On Aug 14, 5:30 pm, Selko <Se...@discussions.microsoft.com> wrote:
> > hey group,
> >
> > nobody can help me?
> >
> > "Selko" wrote:
> > > Hi,

> >
> > > I just created a list view:
> > > $listview= new-object System.Windows.Forms.ListView
> > > $listview.DropDownStyle="DropDownList"
> > > ...
> > > and i have added Items

> >
> > > My question is how can i add an an image (icon) in each row
> > > With an ImageList??

> >
> > > Could you help me to solve my problem

>
> The MSDN documentation for the ListView class has a complete example:
>
> http://msdn2.microsoft.com/en-us/lib....listview.aspx
>
> Good luck.
>
> Jeff
>
>

My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
ImageList for Console Application .NET General


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46