Receive Input from Textbox and Display Results

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 10 years and 10 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.
Locked
User avatar
bmcgree1
Posts: 1
Last visit: Thu May 16, 2013 11:09 am

Receive Input from Textbox and Display Results

Post by bmcgree1 »

I'm a new user on PowerShell studio but so far I'm impressed. I'm trying to do something simple and am running into issues with it. I have an input box and a submit button.

The submit button runs Get-ChildItem on a folder on my c drive, I want to display the results towards the bottom of the form. Also I want to take the input from the textbox and use that for the path, something like: Get-ChildItem <textbox1>

Can anyone point me in the right direction of what controls and code to use? An hour of googling has yielding nothing fruitful. Thanks!
User avatar
davidc
Posts: 5913
Last visit: Mon Jul 08, 2019 8:55 am
Been upvoted: 2 times

Re: Receive Input from Textbox and Display Results

Post by davidc »

If you looking for PowerShell GUI articles the SAPIEN blog is the best source. Please refer to this forum post which links all our related resources.

http://sapien.com/forums/viewtopic.php?f=21&t=6451

As for the TextBox, I recommend reading the Spotlight on the TextBox control:

http://www.sapien.com/blog/2011/06/13/p ... x-control/

It should help answer your question :)

As for selecting a folder you should look at the "TextBox - Browser For Folder" Control Set. It is located in the Control Set tab of the Toolbox Panel. Control Set is prewired so it will save you the hassle of having to script the functionality.

David
David
SAPIEN Technologies, Inc.
This topic is 10 years and 10 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.
Locked