是不是这意思?
图片附件: 游客没有浏览图片的权限,请
登录 或
注册
程序代码:
** Test.prg
CREATE CURSOR dmk (zymc C(20), zydm C(10))
INDEX on ALLTRIM(zydm) TAG dmk_zydm
INSERT INTO dmk VALUES ("专业一", "101")
INSERT INTO dmk VALUES ("专业二", "202")
INSERT INTO dmk VALUES ("专业三", "303")
of = CREATEOBJECT("form1")
of.show(1)
DEFINE CLASS form1 as Form
ADD OBJECT label1 as label WITH top=10,left=10,autosize=.T.,caption="学校专业代码 学校专业名称"
ADD OBJECT text1 as textbox WITH top=25,left=10,width=70
ADD OBJECT text2 as textbox WITH top=25,left=110
PROCEDURE text1.Lostfocus
thisform.text2.value = ""
IF SEEK(ALLTRIM(this.value), "dmk", "dmk_zydm")
thisform.text2.value = dmk.zymc
ELSE
MESSAGEBOX("无效的学校专业代码: " + ALLTRIM(this.value))
ENDIF
ENDPROC
ENDDEFINE