End your code with:
This.SelStart = len(trim(This.Value))
For other ways of getting the cursor at the end of a textbox's value, you have to set SelectOnEntry to .F., and you can not have K in the Format property. To handle cursor placement if a user TABs into the field, in the GotFocus put the following code:
DoDefault() && to run any code in the parent -- this is optional
This.SelStart = len(trim(This.Value))
If you want the cursor at the end if the user clicks in the text box, also put the code in the Click of the textbox.
>In my textfield.keypressed i have this
>
>LPARAMETERS nKeyCode, nShiftAltCtrl
>
>do case
>case nkeycode = F3
> this.value = "BUY"
>case nkeycode = F4
> this.value = "SEEL"
>case nkeycode = F5
> this.value = alltrim(this.value) + " EUR"
>case nkeycode = F6
> this.value = alltrim(this.value) + " USD"
>case nkeycode = F7
> this.value = alltrim(this.value) + " PTE"
>endcase
>keyboard chr(6) && END key
>
>the problem is the cursor stays allways in the beginnig of the textfield and i want it in the end.
>
>What to do ??? what to do ???
>
>Thank you ALL
>
>João
Mark McCasland
Midlothian, TX USA