Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Don't want backspace in textbox to move focus
Message
De
07/07/2000 21:49:36
 
 
À
07/07/2000 21:05:25
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00389768
Message ID:
00389771
Vues:
15
>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
Fred
Microsoft Visual FoxPro MVP

foxcentral.net
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform