* 改为这样,就正常,也就是把Text2隐藏起来,不需要
* 我为什么会这样测试呢,因为很多情况,界面上可能是不需要Text2的
DECLARE LONG PostMessage IN User32 LONG, LONG, LONG, LONG
#DEFINE MY_MSG 0x401
of = CREATEOBJECT("form1")
of.show(1)
RETURN
DEFINE CLASS form1 as Form
ADD OBJECT text1 as textbox WITH left=10,top=10,SelectOnEntry=1
ADD OBJECT text2 as textbox WITH left=10,top=40,Visible =.f.
ADD OBJECT text3 as textbox WITH left=10,top=70
PROCEDURE init
BINDEVENT(this.hWnd, MY_MSG, this, "myMsg")
ENDPROC
PROCEDURE myMsg(hWnd, uMsg, wParam, lParam)
this.text1.setfocus
ENDPROC
PROCEDURE text1.lostfocus
thisform.text2.value = thisform.text1.value
PostMessage(thisform.hWnd, MY_MSG, 0, 0)
ENDPROC
ENDDEFINE
* 我为什么会这样测试呢,因为很多情况,界面上可能是不需要Text2的
DECLARE LONG PostMessage IN User32 LONG, LONG, LONG, LONG
#DEFINE MY_MSG 0x401
of = CREATEOBJECT("form1")
of.show(1)
RETURN
DEFINE CLASS form1 as Form
ADD OBJECT text1 as textbox WITH left=10,top=10,SelectOnEntry=1
ADD OBJECT text2 as textbox WITH left=10,top=40,Visible =.f.
ADD OBJECT text3 as textbox WITH left=10,top=70
PROCEDURE init
BINDEVENT(this.hWnd, MY_MSG, this, "myMsg")
ENDPROC
PROCEDURE myMsg(hWnd, uMsg, wParam, lParam)
this.text1.setfocus
ENDPROC
PROCEDURE text1.lostfocus
thisform.text2.value = thisform.text1.value
PostMessage(thisform.hWnd, MY_MSG, 0, 0)
ENDPROC
ENDDEFINE