Home > Archive > FoxPro Help and Support > December 2005 > Re: How to cause a TextBox's contents to be SELECTED when you SETFOCUS









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: How to cause a TextBox's contents to be SELECTED when you SETFOCUS
Jay B

2005-12-01, 1:24 pm

try either the following in the click event of the textbox:
a) this.setfocus

b) this.selstart=0
this. sellength=len(alltri
m(trans(this.value)))

they both work.


Jud wrote:
> Hi,
> This is VFP6 SP5.
>
> I have a form which has 3 TextBoxes to enter key words for the search
> through a database. When the form first opens the first TextBox has
> been .SETFOCUSed, but if it has some contents, they are not selected
> (Bright White over Dark Blue). But after I press the Search button the
> Search Procedure does SETFOCUS to the TextBox at the end of the
> procedure. At that point, the contents are selected. Which is what I
> want to have happen any time the TextBox has FOCUS. SelectOnEntry =
> .T.. Could I use the "GotFocus" method? If so, what would I put in
> there?
>
> Thanks for any help,
> Jud
>

Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com