• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

ListView + ImageList

S

Selko

#1
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 Computer

S

Selko

#2
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 Computer

J
#3
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/library/system.windows.forms.listview.aspx

Good luck.

Jeff
 

My Computer

S

Selko

#4
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/library/system.windows.forms.listview.aspx
>
> Good luck.
>
> Jeff
>
>
 

My Computer

Users Who Are Viewing This Thread (Users: 1, Guests: 0)