Timothy,
I have done this in the past by subclassing 'Form' and assiging the different procedures whatever code I want. A stripped down example follows:
local testForm
testForm = createObject("myForm")
testForm.visible = .t.
testForm.ExitButton.visible = .t.
READ EVENTS
DEFINE CLASS myForm AS Form
PROCEDURE INIT
this.addObject("ExitButton","myExit")
ENDPROC
ENDDEFINE
DEFINE CLASS myExit AS CommandButton
PROCEDURE CLICK
thisform.release()
ENDPROC
PROCEDURE UNLOAD
CLEAR EVENTS
ENDPROC
ENDDEFINE
Paul A. Busbey
Victoria Insurance