> bDeskTop = .F. > > oMyForm = CreateObj ("frmMyForm") && The form will be created inside _Screen. > oMyForm.Show () > > Clear Events > > bDeskTop = .T. > > oMyForm = CreateObj ("frmMyForm") && It doesn't change, the form is created inside _Screen again. > oMyForm.Show () > > Clear Events > > Define Class frmMyForm as Form > . . . > Desktop = bDeskTop > . . . > EndDefine >The reason it doesn't work the second time is that the form's definition is cached in memory ( to speed up) and it uses the first definition
clear class frmMyForm && see helpBut the wisest would be to subclass frmMyForm, then instantiate either one of the classes
Define Class frmMyForm as Form . . . Desktop = .f. . . . EndDefine Define Class frmMyFormDesktop as frmMyForm . . . Desktop = .t. . . . EndDefine