>>>Hello
>>>
>>>I have a user who wants to have numeric values displayed in 999,999.99 format but entered in 999999.99 format.
>>>
>>>Does anyone know how I can do this?
>>You could create a textbox class with :* Gotfocus
>>this.inputmask = "999999.99"
>>*Lostfocus
>>this.inputmask = "999,999.99"Cetin
>
>Sorry, in my rush to ask the question I forgot to mention that I need to do this in a textbox in a grid. In this case would I still change the inputmask setting on the textbox or on the column?
Steve,
If this will only be used in one column no need to create a class, just go and edit that column.text1's gotfocus, lostfocus.
Otherwise create the class, drop on to the columns that it will be used and delete default control text1 (or set currentcontrol="myTextbox1"). Preferably add a property as savemask to class so your inputmask would be more generic (not constant as 999,999.99):
define class myTextbox as Textbox
savemask = .f.
procedure init
this.savemask = this.inputmask
endproc
procedure gotfocus
this.inputmask = chrtran(this.inputmask,",","")
endproc
procedure lostfocus
this.inputmask = this.savemask
endproc
enddefine
Cetin