>loHiddenForm = CREATEOBJECT('myHiddenForm') >loMainForm = CREATEOBJECT('myMainForm', loHiddenForm) > >loMainForm.Show(1) >clear events > >define class myMainForm as Form > hiddenForm = null > > add object cmdShowActive as commandbutton with caption = "Show Active" > > function init(toHiddenForm as Form) as Boolean > if type('toHiddenForm.Class') = 'C' and toHiddenForm.Class = 'Myhiddenform' > this.hiddenForm = toHiddenForm > endif > return .t. > endfunc > > procedure cmdShowActive.Click() as VOID > if isnull(thisform.hiddenForm) > messagebox('No hidden form found') > else > thisform.hiddenForm.aTextBox.SetFocus() > messagebox(thisform.hiddenForm.ActiveControl.Name) > endif > return null > endproc >enddefine > >define class myHiddenForm as Form > add object cmdDoSomething as commandbutton with caption = "Do it" > add object aTextbox as textbox with value = 'my text box value' > >*!* procedure Activate() as VOID >*!* this.Visible = .f. >*!* return null >*!* endproc >enddefine >