|
Home > Archive > FoxPro Help and Support > December 2005 > How to cause a TextBox's contents to be SELECTED when you SETFOCUS to it?
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 |
How to cause a TextBox's contents to be SELECTED when you SETFOCUS to it?
|
|
|
| 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
| |
|
| Thank you Jay B,
I'll try that, but I still don't understand why the TextBox acts
differently when it was SETFOCUSed both times. Why does your "a)"
cause the word to be selected when mine does not?
Thanks again,
Jud
| |
| Leonid 2005-12-02, 3:25 am |
| Extract from the Help for Format property:
The valid cFunction settings for a TextBox control and Column object are:
....
K Selects all the text when the control gets the focus.
....
Leonid
"Jud" <judsonrp@fastmail.fm> wrote in message
news:1133456390.835117.47200@o13g2000cwo.googlegroups.com...
> 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
>
| |
|
| Sorry Leonid, but "K" in the Format Property did not cause the
TextBox's contents to be selected when the Form first opened with
THISFORM.TextBox.SETFOCUS.
Jud
|
|
|
|
|