以下是引用taohua300在2012-9-24 15:31:17的发言:
给别人代码不测试容易出臭.............
再来一次
dd = Newobject("ws")
dd.show
Read events
Return
DEFINE CLASS ws AS form
DoCreate = .T.
Caption = "Form1"
Name = "Form1"
ADD OBJECT container1 AS container WITH ;
Top = 24, ;
Left = 84, ;
Width = 241, ;
Height = 120, ;
Name = "Container1"
ADD OBJECT command1 AS commandbutton WITH ;
Top = 192, ;
Left = 240, ;
Height = 25, ;
Width = 60, ;
Caption = "Command1", ;
Name = "Command1"
PROCEDURE command1.Click
thisform. = 'ad'
ENDPROC
PROCEDURE container1.init && 给容器添加对象
this.AddObject("command1","commandbutton")
(60,50,60,25)
= .t.
bd = 0
For i = 1 To 5
tt = 'text' + Transform(i)
this.AddObject(tt,"textbox")
this.&tt..move(bd,0,20,25)
this.&tt..visible = .t.
bd = bd + 21
Next
Endproc
ENDDEFINE
*
*-- EndDefine: ws
**************************************************
灰常 灰常 感谢这位兄弟
学到了两个东西
move(60,50,60,25) 和
this.
&tt..move(bd,0,20,25)