How to output results of a function to a ListView form

Welcome Forums General PowerShell Q&A How to output results of a function to a ListView form

Viewing 4 reply threads
  • Author
    Posts
    • #245445
      Participant
      Topics: 2
      Replies: 5
      Points: 17
      Rank: Member

      Trying to figure out how I can output the results of a function to show in a listview in my winforms GUI?
      I have the following setup to create a listview and want to know what I need to add to get a function I will be creating to output to the listview window. I am a bit new to this so I am not really sure where to start.

      [/crayon]
    • #245448
      Participant
      Topics: 7
      Replies: 557
      Points: 2,122
      Helping Hand
      Rank: Community Hero

      I just helped somebody with something similar on Reddit yesterday. Perhaps this can help get you started.

      TreeView/Directory Tree Help – Stuck from PowerShell

    • #245601
      Participant
      Topics: 2
      Replies: 5
      Points: 17
      Rank: Member

      Not sure I really follow what is happening in your code sadly. Not sure what is actually putting the results of the function into the forms element as text.

      I actually thinking for my purpose a multi-line textbox is better to use that listview now. My function is just checking multiple servers and reporting back if a service is running or stopped so I won’t need to interact with the data in the box.

      • This reply was modified 1 month, 3 weeks ago by kg213749.
    • #245610
      Participant
      Topics: 7
      Replies: 557
      Points: 2,122
      Helping Hand
      Rank: Community Hero

      I read it wrong anyways, my example is for a treeview. Here is a snippet from another script that demonstrates listview

    • #245622
      Participant
      Topics: 2
      Replies: 5
      Points: 17
      Rank: Member

      Still a bit confused…

      I don’t see a function in the example so not sure entirely how its showing what a function would output to the console and putting it into the form element. I decided to use a textbox instead of a listview.

      My goal is take my function that is checking servers to see if specific services are running and outputting that data to the textbox when a button is clicked.

Viewing 4 reply threads
  • You must be logged in to reply to this topic.