Walter Meester
HoogkarspelNetherlands
>>I tend not to use explicit Edit mode. If a user want to edit some data he (or she) clicks (or tabs right to it) the data and changes it. All the changed data is coloring red just to let user see wich data has been changed. If the user want to undo the data, just click the undo button and the data is coloring blue again.(In my program editable data is colored blue, changed data is colored red, non-editable data is colored black)
>
>Now that's a neat idea. How, may I ask do you colour the changed data? Also, how do your users save the data? Is it done with a buttton or in the valid of each object?
In the refresh event of the object:
LOCAL cAlias
cAlias=IIF(!EMPTY(THIS.Controlsource) AND AT(".",THIS.Controlsource) > 2,;
LEFT(THIS.Controlsource, AT(".",THIS.Controlsource)-1),"yy")
DO CASE
CASE THIS.SpecialEffect=0
THIS.Forecolor=RGB(0,0,0)
CASE This.controlsource="m."
THIS.Forecolor=RGB(0,0,255)
CASE THIS.ReadOnly
THIS.Forecolor=RGB(64,64,64)
CASE !EMPTY(THIS.Controlsource) AND OLDVAL(THIS.Controlsource, cAlias) # EVAL(THIS.Controlsource)
THIS.Forecolor=RGB(255,0,0)
OTHERWISE
THIS.Forecolor=RGB(0,0,255)
ENDCASE
in the lostfocus of the object:
THISFORM.Refresh
Remark: you have to use buffering to have this to work.
I've put these code into my subclassed textboxes, comboboxes and editboxes
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only