Page 1 of 1
Posted: Fri Oct 26, 2018 7:52 am
On a powershell studio form we use text boxes so users can enter data. Is there a way to show shadow text in the text box saying what to enter? Example if the Textbox was for "computer name" to display enter computer name in the textbox so they know what to enter?
Posted: Fri Oct 26, 2018 8:25 am
In the Textbox control, use the Text property to enter a text to be display when it initially open the forms.
Other than that, you could add code to keep displaying the text after it get's process.
Posted: Fri Oct 26, 2018 8:32 am
You can use the TextBox - Watermark control set:
Posted: Fri Oct 26, 2018 2:39 pm
Thanks, I read that webpage. I'm unclear on where you place all of this code. Is it on the properties of the textbox? Or under "form load"? Or both?
Posted: Fri Oct 26, 2018 2:56 pm
What code. Just add the watermark textbox to the form from the toolbox. The watermark can be set on the properties browser tab "Tab" property or in code anywhere you need to set it.
Code: Select all
if($this.Text -eq "")
#Display the watermark
$this.Text = $this.Tag # or assign a different source here
$this.ForeColor = 'LightGray'