InteractiveChange, ProgrammaticChange
InteractiveChange and ProgrammaticChange give us the kind of control we've always wanted over changes in a form. These two alone made the upgrade from FoxPro 2.x to VFP worthwhile. InteractiveChange fires when a control's Value changes due to a user action. ProgrammaticChange fires when the Value changes because of something in code.
Usage |
PROCEDURE InteractiveChange | ProgrammaticChange [ LPARAMETERS nIndex ] |
For most controls, InteractiveChange doesn't fire when you re-choose the same item you just chose. For example, clicking the OptionButton that's already chosen in a group doesn't fire InteractiveChange for the OptionGroup. (Most of the time, this makes sense to us, since the Value of the control hasn't changed.) CommandGroups are the exception. Pressing a button in a CommandGroup always fires InteractiveChange for the group. |
In VFP 5.0a and earlier, changes to a combo's or list's Selected property do not fire ProgrammaticChange, even if doing so changes the object's Value. This is a bug, plain and simple. Fortunately, it was fixed in VFP 6. |
Example |
PROCEDURE InteractiveChange * This might be the InteractiveChange procedure for a text box * that is the only required input in a dialog. * Once the user has entered a value, we enable the OK button. ThisForm.cmdOK.Enabled = .T. RETURN |
See Also |