Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
CTRL+C fireing keypress PAGEUP/PAGEDOWN
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00822938
Message ID:
00822944
Vues:
17
Thank you!

>Terry,
>
>CTRL+C generates the same code as PAGE DOWN - 3. CTRL+R the same as PAGE UP - 18. You've to check nShiftAltCtrl value to make sure that CTRL wasn't pressed. Also, VFP has DO CASE ... ENDCASE statement to check for multiple exclusive conditions.
PROCEDUR Keypress(nKeyCode, nShiftAltCtrl)
>	DO CASE
>	CASE nKeyCode = 18 AND nShiftAltCtrl = 0
>		SetFocusforPageKeys(THIS.NAME,VAL(THIS.PARENT.lblItemNo.CAPTION),-1)
>	CASE nKeyCode = 3 AND nShiftAltCtrl = 0
>		SetFocusforPageKeys(THIS.NAME,VAL(THIS.PARENT.lblItemNo.CAPTION),1)
>	OTHERWISE
>	ENDCASE
>ENDPROC
CTRL+V pastes whatever is in the text clipboard. You'll have to figure out how "DEFINE CLASS SUBTEXTBOX" gets there.
>
>>My project has a textbox with a Keypress event coded to fire procedures when either PAGE DOWN or PAGE UP are pressed. When I press CTRL+C (to copy textbox contents), the Keypress event fires as if the PAGE DOWN KEY.
>>
>>Also wierd: When I press CTRL+V, to paste, "DEFINE CLASS SUBTEXTBOX" the class definition header, appears in the field contents.
>>
>>
define class subTextBox as TextBox
>>format="R"
>>height=17
>>specialeffect=1
>>procedur KeyPress(nKeyCode, nShiftAltCtrl)
>>if nKeyCode=18
>>   SetFocusforPageKeys(this.name,val(this.parent.lblItemNo.Caption),-1)
>>else
>>if nKeyCode=3
>>   SetFocusforPageKeys(this.name,val(this.parent.lblItemNo.Caption),1)
>>else
>>endif
>>endif
>>endproc
>>enddefine
Imagination is more important than knowledge
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform