以下是引用C469143在2012-9-17 11:06:46的发言:
请教具体代码
请教具体代码
我也是刚接触 写个短短的代码吧 不过没用到数据源 下拉列表需要手动初始化
程序代码:
************************************************** *-- 主函数 SET CLOCK on SET TALK OFF frmMain = CREATEOBJECT("C_Form") frmMain.show READ events RETURN * *-- 程序结束 ************************************************** ************************************************** *-- 类: C_Form (d:\vfp\td\12.vcx) *-- 父类: form *-- 基类: form DEFINE CLASS C_Form as Form _screen.minbutton = .f. _screen.MaxButton = .f. caption = "组合框" width = 300 height = 200 autocenter = .T. ADD OBJECT com_box as ComboBox WITH ; height = 20, width = 50,; top = 80, left = ThisForm.width/2 - 80 PROCEDURE init WITH = 0 for i = 1 to 5 a = 64 + i .list(i) = chr(a) endfor .inputmask = .displayvalue ENDWITH endproc PROCEDURE com_box.interactivechange if not Between(Asc(), 65, 69) MessageBox("上帝保佑"+) else MessageBox("菩萨保佑"+) endif ENDPROC PROCEDURE destroy a = MESSAGEBOX("真的要退出吗", 1 + 32, "确认") IF a == 1 CLEAR EVENTS ELSE RETURN ENDIF ENDPROC * *-- EndDefine: C_Form **************************************************
梅尚程荀
马谭杨奚