>It seems the default behaviour of textboxes (and presumably editboxes), is that if you press backspace when at the beginning of the control, the focus moves to the previous control in tab order. So if you hold down backspace, you can end up not just deleting the current field, but previous fields as well.
>
>Is there something I can put in my textbox class to prevent this happening, as it doesn't seem like standard UI behaviour to me.
>
>I tried
>
>IF lastkey()=127
> RETURN .F.
>ENDIF
>
>in the Valid of the control, but (a) this displays 'invalid input' in the corner, and (b), if the last key was backspace, but you specifically try and move to another field using the mouse, the lastkey is still valid, and it won't let you move.
>
>Ben
Almost right. You need to put similar code in the KeyPress of your baseclass EditBox and TextBox.
IF nKeyCode=127 AND this.SelStart=0
NODEFAULT
ENDIF