Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Auto place cursor to "right" of text in text box ? 1

Status
Not open for further replies.

cgc22

Programmer
Jan 17, 2007
10
US
Hi,
I am using visual foxpro 8.0. I have "forms" that I've created that requires text within a "text box" to be edited
by the user. What property or method within a textbox or
edit box do I use to make the "CURSOR" upon entering a
textbox (by pressing the ENTER KEY) to automatically go the the "far right" of the "end" of the text in that text box? The cursor always enters the textbox on the far left
side which is inconvient for the user to backspace out
text we want to delete ! I also have this same problem when entering textbox within a grid. Any help would be greatly appreciated.

Greg
 
Put in GotFocus Event of that TextBox:
Code:
this.SelStart = ALLTRIM(this.Value)+1

If you want to do that ONLY when the user enter to that TextBox with ENTER key:
Code:
IF LASTKEY() == 13
   this.SelStart = ALLTRIM(this.Value)+1
ENDIF

Borislav Borissov
VFP9 SP1, SQL Server 2000/2005.
MVP VFP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top