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.