用途不明显,但作为练习,可以了。有些做法走了弯路,不过那是你不熟悉的关系。
授人以渔,不授人以鱼。
Clear All Main() Procedure Main() Local lo_MainForm lo_MainForm = NewObject("C_Form") lo_MainForm.Show Read Events Return EndProc Define Class C_Form as Form Width = 400 Height = 400 AutoCenter = .T. Caption = "Experiment" Procedure Init With This .AddObject("xx", "CommandButton") With this.xx .Top = 100 .Left = 100 .Height = 50 .Width = 100 .Caption = "XXbtn" .Visible = .T. EndWith EndWith EndProc Procedure xx.Click MessageBox("阿弥陀佛") EndProc Procedure destroy Clear Events EndProc EndDefine编译器会提示他认不到XX..........