publi yform yform=newObject("asup") yform.show(1) * DEFINE CLASS asup AS form Top = 37 Left = 267 Caption = "Form1" Name = "Form1" ADD OBJECT text1 AS textbox WITH ; Height = 25, ; Left = 120, ; Top = 12, ; Width = 121, ; Name = "Text1" ADD OBJECT command1 AS commandbutton WITH ; Top = 144, ; Left = 216, ; Height = 49, ; Width = 133, ; Caption = "Command1", ; Name = "Command1" ADD OBJECT list1 AS listbox WITH ; Height = 109, ; Left = 12, ; Top = 96, ; Width = 169, ; Name = "List1" PROCEDURE my messagebox("click") thisform.command1.setfocus ENDPROC PROCEDURE Init bindevent(thisform,"click",thisform,"my") ENDPROC PROCEDURE text1.GotFocus messagebox("textbox have the focus") ENDPROC PROCEDURE text1.LostFocus messagebox("textbox lost the focus") ENDPROC ENDDEFINE *-- EndDefine: asup