Windows Vista Forums

ListView + ImageList

  1. #1


    Selko Guest

    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

  2. #2


    Selko Guest

    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

  3. #3


    Jeff Guest

    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

  4. #4


    Selko Guest

    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

ListView + ImageList

Similar Threads
Thread Forum
ListView
I need to pick up the "TotalItemsLabel" text in my C# method. How to do that if this is the part of my Default.aspx page which is generated from...
.NET General
Sorting a ListView
I am attempting to sort the ItemsCollection of a ListView in C# / WPF. I have it all hooked up and for the base case it is working fine. Base case...
WinFX General
ImageList for Console Application
I am experimenting with a concept the engineers want. I want to create an app that runs in the console. When an event happens, I want to display...
.NET General
ListView Columns
So I have usercontrol that contains a ListView. I would like one of my columns to be non-resizable and the others to be resizable by the user. I...
Avalon
listview binding
I have 2 listview box in my window application . The first one is bind to the object class I created and displays the page no ( taken from file...
Avalon
WPF ListView
Is there a event called 'OnItemBound" or similar in WPF listview. Or any way of get hold to a list view item in code behind before it render to UI....
Avalon
Getting ListView items to exand to width of ListView
Is it possible to get the items placed inside of a ListView Control to automatically expand to the full width of the Control? If I place them inside...
Avalon