Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Controlling Movement From One Text Box To Another
Message
De
23/02/2002 10:28:05
Carmen Gassi
Perseus Software Systems
Oakville, Ontario, Canada
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Titre:
Controlling Movement From One Text Box To Another
Divers
Thread ID:
00624089
Message ID:
00624089
Vues:
51
I am having difficulty controlling movement from one text box to another on a given form. I have set up 3 text boxes which use 3 fields from a table for their respective data control source. In the INIT method of the form I have enabled/disabled certain controls depending on the state of certain logical fields in the table. This is fine, and the cursor starts in the appropriate text box. In the KEYPRESS event or the LOSTFOCUS (I have tried it both ways), I move the record pointer in the table, and set the enable property of the controls. Everything seems to happen properly, except under 1 condition. When both logical fields are .t., all 3 text controls are enabled and the focus is set to the first of the text controls. What happens, however, is that the cursor immediately moves to the 2nd of the controls. I have put some debugging code in the methods of the respective controls and found that the control is indeed receiving the focus, it is enabled properly, but the cursor doesn't seem to stay in the control. I have obviously missed something, I'm not sure what. All suggestions appreciated greatly.

I have done more debugging, for the text box control that is the problem, it seems that the getfocus event fires, and then the lostfocus event fires immediately after, and I can't find anything in the control's methods or events that would cause this.

Further update, I have been able to force the cursor to stay in the text box by adding a property to the form which only is set to true when the enter key is pressed in the text box in question. I then checked in the valid event of the same control and only returned .t. if the enter key had been pressed. This works, but doesn't answer the question why the text doesn't return focus on its own. Still would appreciate some ideas.

Thanks to all
Regards,
Carmen
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform