Thank you very much for your code.
This works perfekt for the right arrow, but to have it work for the left arrow I made this modification:
***
do case
case nKeyCode = 4 and nshiftaltctrl = 0
with this
if .selLength > 0
.selStart = .selStart + .selLength
nodefault
endif
endwith
case nKeyCode = 19 and nshiftaltctrl = 0
with this
if .selLength > 0
.selStart = .selStart
nodefault
endif
endwith
endcase
***
But schould not this behaviour be a ground standard in VFP as in other programs?
It must be wrong to make my own code to do this???
/Kjell
>Kjell,
>
>Putting this in your keypress() method will cause it to behave like the editbox (you can put it in your baseclass):
>
>
>LPARAMETERS nKeyCode, nShiftAltCtrl
>
>if nKeyCode = 4 and nshiftaltctrl = 0
> with this
> if .selLength > 0
> .selStart = .selStart + .selLength
> nodefault
> endif
> endwith
>endif
>