Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Problem with form.keypress
Message
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Titre:
Problem with form.keypress
Divers
Thread ID:
00766859
Message ID:
00766859
Vues:
60
I have a form with a pageframe on it. To go from one page frame to the other, the user want to use PgUp & pgDown. Fine with me. So I put the following code in the form' keypress method (The keypreview form property has been set to .t.):

IF nKeyCode = 18 && Page Up
THISFORM.Wspageframe1.ActivePage = 1
THISFORM.Wspageframe1.page1.txtPoNo.SetFocus()
ENDIF
IF nKeyCode = 3 && Page Down
THISFORM.Wspageframe1.ActivePage = 2
THISFORM.Wspageframe1.page2.ScnItem.SetFocus()
ENDIF

It works fine with the page frame BUT there is a major problem with it:
If I am on a field of the first page; I enter 1 in a field and, without doing tab, I press PgDown to go to the second page; The 1 is in limbo somewhere and is not in my field value (still showing 0). From a suggestion, I even added this.value = this.value in the field valid method. No success. SO I said that I just need a tab and I modified the code for the following:

IF nKeyCode = 3 && Page Down
KEYBOARD '{TAB}' && To force a valid value
THISFORM.Wspageframe1.ActivePage = 2
THISFORM.Wspageframe1.page2.ScnItem.SetFocus()
ENDIF
No more sucess....
Any idea ?

Thanks
Eric
Eric Crespin
Consultant
PC PLUS Software Inc.
www.pcplus.ca
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform