THISFORM.EditState=1 THISFORM.SetAll("Enabled",.T.) THISFORM.Refresh()With VFP6, there is a much simpler way to do this. With the new ASSIGN method, you can add an _Assign to any property, custom or native. So...we would create an EditState_Assign method for our form, with the following code (THIS not THISFORM as its a form method):
LPARAMETERS tNewVal THIS.EditState=tNewVal THIS.SetAll("Enabled",.T.) THIS.Refresh()The Edit button Click() method is reduced to nothing but THISFORM.EditState=1. The EditState_Assign method automatically does the rest, encapsulating the behavior of a state change at the level it belongs.