Hi,
release a form with OOP need to call form.release method.
But this have bugs:
PUBLIC oform1
oform1=NEWOBJECT("form1")
oform1.Show
RETURN
DEFINE CLASS form1 AS form
AllowOutput = .F.
Caption = "Form1"
Name = "Form1"
ADD OBJECT tx1 AS textbox WITH ;
Left = 14, ;
Top = 11, ;
Width = 100, ;
Name = "TX1"
PROCEDURE Activate
ON KEY LABEL CTRL+F11 _SCREEN.ActiveForm.Release
ON KEY LABEL CTRL+F12 RELEASE WINDOWS _SCREEN.ActiveForm.Name
ENDPROC
PROCEDURE Deactivate
ON KEY LABEL CTRL+F11
ON KEY LABEL CTRL+F12
ENDPROC
PROCEDURE Release
? 'release'
ENDPROC
PROCEDURE tx1.GotFocus
? 'gotfocus'
ENDPROC
PROCEDURE tx1.When
? 'when'
ENDPROC
PROCEDURE tx1.Valid
? 'valid'
ENDPROC
PROCEDURE tx1.LostFocus
? 'lostfocus'
ENDPROC
ENDDEFINE
bug 1:
if you exec form.release with a focus control, no events fired on focus
control ( Valid and Lostfocus sequence are need)
bug 2:
use a KEY LABEL shortcut for release, exec release method,
but after fired a when+gotfocus (like setfocus cycle) events on focus control.
bug 3: this simple schema is not applicable because deactivate not
fired when the avtive form is released.
warning 1: this command is not oop foxpro command, and fired a
form.queryunload event, but need a management of form names for
make they unique ( if VFP open one SCX two times, the name is the same ).