Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
On Key Label?
Message
 
À
17/09/1997 09:59:03
Elyse Pomerantz
Dynamic Data Concepts, Inc.
Brooklyn, New York, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00050292
Message ID:
00050387
Vues:
81
>>Hello,
>>
>>I have an EditBox to key in notes for a customer. I would like to automatically insert todays date when the customer hits CTRL+D or whatever. I have played around with a few things to no avail like on key label in the keypress event of the editbox.
>>
>>Any ideas?
>>
>>Paul
>
>Paul,
>
>I do just this. Here's how I do it:
>
>In the GotFocus of the EditBox I have: ON KEY LABEL CTRL+D _screen.activeform.InsDate()
>In the LostFocus I have: ON KEY LABEL CTRL+D
>
>*** Procedure InsDate
>thisform.edtMemoText.value=left(.value,.SelStart)+dtoc(date())+" "+right(.value,len(.value)-.SelStart)
>
>This allows the date to be inserted at any point in the EditBox, not just at the end.
>
>Elyse

Hi Elyse,

I found a way to accomplish this last night that I thought you might be interested in, its just a few lines of code in the Keypress event that also allows me to insert the date at any point instead of just at the end.
LPARAMETERS nKeyCode, nShiftAltCtrl
if nKeyCode = 20 and nShiftAltCtrl = 2 then  &&CTRL+T
	nodefault
	keyboard dtoc(date()) clear
endif



I would also appreciate any comments if this is not a good idea, as I am fairly new to Visual Foxpro and can always use any helpful insight.

Regards,

Paul
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform