In a grid I use a currency field. But I want it have some special behavior. For example when i'm going to input the value -500.00, the normal approach would be for the user to type -500 and then Enter or Tab. But I have done a method that saves one keystroke. The user can type just 500- and get the same result. The following code has I put in the KeyPress method of the textfield and it just works just perfect. But by doing this there seem to be a lot of events that dosn't fire. Is there any danger in this? Is there some importent "background" code that dosn't execute?
KeyPress Method:
LPARAMETERS nKeyCode, nShiftAltCtrl
do case
case nKeyCode = 43 && +
This.Valid(13, .F.)
This.LostFocus() && LostFocus has the code the moves me to the next field
NoDefault
return .f.
case nKeyCode = 45 && -
This.Valid(13, .T., This.Value)
This.LostFocus()
NoDefault
return .f.
endcase
/Mårten Törnquist
---( Mårten Törnquist )---