how to add code to form?

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.
Locked
User avatar
mqh777
Posts: 237
Last visit: Thu Jun 13, 2019 7:31 am

how to add code to form?

Post by mqh777 »

I created a script that runs a Write-Host "Hello World" command. How do I do the following.

1. Add this code to a form?
2. Add this code to a Button on a form?

Thanks

User avatar
mqh777
Posts: 237
Last visit: Thu Jun 13, 2019 7:31 am

Re: how to add code to form?

Post by mqh777 »

Ok, I figured that out. But now how do I do the following. A user enters text into a field and I need to store that in a variable and then use that variable in another script.

jvierra
Posts: 14759
Last visit: Thu Apr 15, 2021 5:14 pm
Answers: 9
Has voted: 3 times
Been upvoted: 7 times

Re: how to add code to form?

Post by jvierra »

Here is a good place to start learning how to use forms.

http://www.sapien.com/blog/2012/06/04/u ... istrators/

Locked