Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Show text in text box as help, but clear when typeing
Message
De
31/01/2012 07:32:06
 
 
À
31/01/2012 07:17:49
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 9
Divers
Thread ID:
01534085
Message ID:
01534124
Vues:
57
Peter,

since the tag property is not used by VFP for most (all?) controls, it can be used to store other things. So your code doesn't change anything,really. Instead you can use this in gotfocus
This.Value = This.Tag
>Hi Janis,
>Thanks.
>this works the first time around, but not when I enter the control again.
>I added
this.tag=[ClaimNo./Claimant]
to the getfocus() but i still keeps the previous entry on display
>This kind of control is now quite common.
>when the control is empty it should display the tag in your example display in 192,192,192 color
>as soon as th user starts typing the tag should go away and the entered text should be the regular color (black in my case).
>
>btw, I was alway wondering what the tag property is good for. I used it to remember the old value of a control...
>
>
>Peter
>
>>
>>DEFINE CLASS FancyText AS Textbox
>>
>>	This.Tag = "Enter Text"
>>	
>>	PROCEDURE Init
>>		This.Value = This.Tag
>>	ENDPROC
>>	
>>	PROCEDURE Keypress
>>		LPARAMETERS nKeyCode, nShiftAltCtrl
>>		WITH This
>>			IF NOT EMPTY( .Tag )
>>				.Value = ""
>>				.Tag = ""
>>			ENDIF
>>		ENDWITH
>>	ENDPROC
>>ENDDEFINE
>>
>>
>>
>>Use the Tag property to set the display text for before any keys are pressed.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform