textbox
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.
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.
textbox
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?
- mxtrinidad
- Posts: 399
- Last visit: Tue May 16, 2023 6:52 am
Re: textbox
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.
Other than that, you could add code to keep displaying the text after it get's process.
Re: textbox
You can use the TextBox - Watermark control set:
https://www.sapien.com/blog/2013/08/14/new-control-set-textbox-watermark/
https://www.sapien.com/blog/2013/08/14/new-control-set-textbox-watermark/
David
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.
Re: textbox
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?
Re: textbox
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
$Watermark_Leave={
if($this.Text -eq "")
{
#Display the watermark
$this.Text = $this.Tag # or assign a different source here
$this.ForeColor = 'LightGray'
}
}