loForm = CREATEOBJECT('myForm') loForm.Show(1) DEFINE Class myForm as FORM ADD OBJECT Button1 as CommandButton WITH Caption = 'Click Me', Enabled = .t., left = 0, top = 2, height = 24 ADD OBJECT Button2 as CommandButton WITH Caption = 'Disable "Click Me" button', Enabled = .t., left = 100, top = 2, WIDTH = 175, height = 24 PROCEDURE Button2.Click() thisform.Button1.Enabled = not thisform.Button1.Enabled ENDPROC PROCEDURE Button1StatusChange() thisform.Button2.Caption = IIF(thisform.Button1.Enabled, 'Disable', 'Enable') + ' "Click Me" button' ENDPROC FUNCTION Init() BINDEVENT(thisform.Button1, 'Enabled', thisform, 'Button1StatusChange', 1) && 1 so it changes the property before firing the Button1StatusChange method RETURN DODEFAULT() ENDFUNC ENDDEFINE