Insert your output into textbox form when button is clicked.

Welcome Forums General PowerShell Q&A Insert your output into textbox form when button is clicked.

Viewing 5 reply threads
  • Author
    Posts
    • #258970
      Participant
      Topics: 4
      Replies: 7
      Points: 58
      Rank: Member

      Hi
      I am trying to insert my ping result to the textbox when button is clicked. Below is the PS for GUI.

      And below is the pingInfo function.

      How can I direct the ping result to $outputBox

      • This topic was modified 1 month ago by mrdon03.
      • This topic was modified 4 weeks ago by grokkit. Reason: code formatting - please read the guide https://powershell.org/forums/topic/guide-to-posting-code-2/
      • This topic was modified 4 weeks ago by grokkit.
    • #259579
      Participant
      Topics: 0
      Replies: 47
      Points: 448
      Helping Hand
      Rank: Contributor

      Hello mrdon03,

      Try something like this:

      Reference.

      Hope that helps.

    • #259585
      Participant
      Topics: 4
      Replies: 7
      Points: 58
      Rank: Member

      Hello mrdon03,

      Try something like this:

      Reference.

      Hope that helps.

      Thanks. Do you know how can i apply the font color as well.
      For example:

      computer is Online – GREEN
      computer is Offline – RED

      • This reply was modified 4 weeks ago by mrdon03.
      • This reply was modified 4 weeks ago by mrdon03.
    • #259876
      Participant
      Topics: 0
      Replies: 47
      Points: 448
      Helping Hand
      Rank: Contributor

      Try using SelectionControl property.

      Here is C# example

      Hope that helps.

    • #259909
      Participant
      Topics: 4
      Replies: 7
      Points: 58
      Rank: Member
      • This reply was modified 3 weeks, 5 days ago by mrdon03.
    • #260005
      Participant
      Topics: 25
      Replies: 197
      Points: 718
      Helping Hand
      Rank: Major Contributor

      Hello mrdon03,

      Try something like this:

      <link rel=”stylesheet” type=”text/css” href=”https://powershell.org/wp-content/plugins/urvanov-syntax-highlighter/themes/powershell-ise/powershell-ise.css”&gt;
      <link rel=”stylesheet” type=”text/css” href=”https://powershell.org/wp-content/plugins/urvanov-syntax-highlighter/fonts/liberation-mono.css”&gt;

      Reference.

      Hope that helps.

      thanks for the appendtext control, wasn’t aware of that. much easier than building large blocks of strings for results.

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