none
Adding programs list to a listview control, with icons RRS feed

  • Question

  • Hi !

    I'm trying to made a GUI with a listview (which contains 3 groups). On each groups, there's few programs we use daily in my office. The display config of my listview is "smallIcon".

    I would like to display these programs on my listview with their own associated icon. I think it's possible, but I don't find any  help over the Internet :(

    Later, each users of my script may be able to add some software (by a simple "browse" button for exemple), and I need that the program appears in this listview with its own icon too...

    I have no idea on how to proceed... And if it is possible, i wouldn't like to use the param imagelist (to avoid the icons files to be saved on a network drive).

    Thank's a lot in advance.

    Wednesday, August 12, 2015 10:17 AM

Answers

  • As I notes, the ListView control is an advanced control that assumes in depth knowledge of Windows Forms.  I am sure that if anyone had a simple example they would post it.

    Start by reviewing the C# examples you can find easily by searching.  Look at how the examples add icons and manage the control.  Convert the C# into PowerShell.  Post here with questions as they arise.

    This si how most scripters add new technologies.  Once you learn how to do this excerciose you will find that there are thousands of examples of most things available.

    With a small amount of searching I found this example:
    https://gallery.technet.microsoft.com/scriptcenter/73dd51d4-d942-4490-aa10-f6c2ac5b233e

    Image what a larger search could find.


    \_(ツ)_/

    • Marked as answer by Neandril Thursday, August 13, 2015 11:40 AM
    Wednesday, August 12, 2015 5:52 PM

All replies

  • I recommend that you start by learning Windows Forms. There are books available fo r this.

    The ListView I a very complex control.  Few script user use it because it takes time to learn.

    Here is a starter article: https://www.sapien.com/blog/2012/04/04/spotlight-on-the-listview-control-part-1/

    There are three parts to the article.


    \_(ツ)_/

    Wednesday, August 12, 2015 11:09 AM
  • Thank's for your answer.

    I already seen this article before, but they don't explain how to have a similar thing as shown on the firsts pictures. It's exactly what I need to do.

    Wednesday, August 12, 2015 11:59 AM
  • As I notes, the ListView control is an advanced control that assumes in depth knowledge of Windows Forms.  I am sure that if anyone had a simple example they would post it.

    Start by reviewing the C# examples you can find easily by searching.  Look at how the examples add icons and manage the control.  Convert the C# into PowerShell.  Post here with questions as they arise.

    This si how most scripters add new technologies.  Once you learn how to do this excerciose you will find that there are thousands of examples of most things available.

    With a small amount of searching I found this example:
    https://gallery.technet.microsoft.com/scriptcenter/73dd51d4-d942-4490-aa10-f6c2ac5b233e

    Image what a larger search could find.


    \_(ツ)_/

    • Marked as answer by Neandril Thursday, August 13, 2015 11:40 AM
    Wednesday, August 12, 2015 5:52 PM
  • Thank's a lot for this link, it was exactly what I'm looking for.

    Fyi, I already tried to visit the author website, but it forbidden by my company policie :/

    So, I was able to do what i'm triing since few days... :)

    See you.

    • Marked as answer by Neandril Thursday, August 13, 2015 11:40 AM
    • Unmarked as answer by Neandril Thursday, August 13, 2015 11:40 AM
    Thursday, August 13, 2015 11:40 AM