有一个表为bm 有两个字段bh,xm
在combo控件中输入的bh的内容,能否在控件中显示xm的内容?并实现渐进式显示?如何实现?谢谢。
------解决方案--------------------------------------------------------
- SQL code
*---- VFP9.0代码OFORM=NEWOBJECT("FORM1")OFORM.SHOWREAD EVENTSRETURNDEFINE CLASS FORM1 AS FORM AUTOCENTER=.T. CAPTION="组合框示例之五" MAXBUTTON=.F. SHOWTIPS=.T. SHOWWINDOW=2 WINDOWTYPE=1 ADD OBJECT COMBO1 AS COMBOBOX WITH LEFT=10,TOP=10,TOOLTIPTEXT="输入〖编号〗后,按回车键显示〖编号〗所对应的【姓名】" PROCEDURE COMBO1.INIT CREATE CURSOR TABNAME (编号 C(3),姓名 C(6)) FOR I=1 TO 5 INSERT INTO TABNAME VALUES(PADL(I,3,"0"),REPLICATE(CHR(I+64),6)) ENDFOR WITH THISFORM.COMBO1 .COLUMNCOUNT=FCOUNT() .ROWSOURCE="TABNAME" .ROWSOURCETYPE=2 ENDWITH ENDPROC PROCEDURE COMBO1.KEYPRESS LPARAMETERS nKeyCode, nShiftAltCtrl IF nKeyCode=13 THIS.DISPLAYVALUE=THIS.LIST(THIS.LISTITEMID,2) ENDIF ENDPROC PROCEDURE DESTROY CLEAR EVENTS ENDPROCENDDEFINE