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.
Locked
User avatar
cillox
Posts: 2
Joined: Mon Jan 30, 2012 11:39 pm

Select text in a textbox

Post by cillox » Mon Jan 30, 2012 11:39 pm

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
Joined: Thu Aug 18, 2011 4:56 am

Select text in a textbox

Post by davidc » Tue Jan 31, 2012 3:40 am

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
Joined: Mon Jan 30, 2012 11:39 pm

Select text in a textbox

Post by cillox » Tue Jan 31, 2012 7:22 am

Oh, thanks David!Useful information. ;-)

Locked