Here's a simple class to create an exit button (this IS a quite stripped down version) but it's the basics of what you need
DEFINE CLASS myButton as COMMANDBUTTON
PROCEDURE Click
thisform.release
CLEAR EVENTS
ENDPROC
caption = 'Exit'
ENDDEFINE
You define your class, then you simple place a procedure within the class of click or Dblclick to contain what should happen in your event.
Paul A. Busbey
I.S. Department
Sparagowski & Associates
Paul A. Busbey
Victoria Insurance