Select text in a textbox

This forum can be browsed by the general public. Posting is no longer allowed as the product has been discontinued.
This topic is 12 years and 1 month 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.
User avatar
cillox
Posts: 2
Last visit: Wed Feb 01, 2012 6:05 am

Select text in a textbox

Post by cillox »

Hi, I want to select the text in a textbox, in the same manner when user double-click into the textbox.I try with:$textbox1.Select(0, $textbox1.Text.Length)I try with:$textbox1.SelectAll()and$textbox1.Select()but nothing.I found many examples for C#, but for Powershell not.Please, can someone help me?EDIT:---------Ok, how a stupid I am!This works: $textbox1.Focus() $textbox1.Select(0, $textbox1.Text.Length) Sorry, but I'm an absolute beginners! :-)


cillox2012-01-31 06:54:40
User avatar
davidc
Posts: 5913
Last visit: Mon Jul 08, 2019 8:55 am
Been upvoted: 2 times

Select text in a textbox

Post by davidc »

Set the TextBox's HideSelection property to false and you no longer need to focus on the control. David
davidc2012-01-31 10:40:42
David
SAPIEN Technologies, Inc.
User avatar
cillox
Posts: 2
Last visit: Wed Feb 01, 2012 6:05 am

Select text in a textbox

Post by cillox »

Oh, thanks David!Useful information. ;-)
This topic is 12 years and 1 month 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.