Ask questions about creating Graphical User Interfaces (GUI) in PowerShell and using WinForms controls.
Forum rules Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 1 year and 8 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
I have a simple form (psf) to test with a input box (textbox1) and a button. For some reason I can't get the the text that was entered to display. When I enter text into textbox1 and click the button "Clicked" displays but not the text. Is there another way to display input? I have a few other forms where this works.
$form1_Load={
#TODO: Initialize Form Controls here
}
$button1_Click = {
#TODO: Place custom script here
Write-Host "Clicked"
Write-Host "$($textbox1.Text)"
}
Note that Write-Host is not normal output command. It is a command that can nly output to a console and it cannot be redirected using normal methods. And yes, it is the only way to do direct output to a console from a form and may not work all of the time.
I recommend getting one of the excellent books on PowerShell and learning PowerShell beyond just guessing. Also review the articles on this website on how to use forms and controls with PowerShell.
This topic is 1 year and 8 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.