vfp表单设计实验报告

上传人:正** 文档编号:41330035 上传时间:2018-05-29 格式:DOC 页数:4 大小:40KB
返回 下载 相关 举报
vfp表单设计实验报告_第1页
第1页 / 共4页
vfp表单设计实验报告_第2页
第2页 / 共4页
vfp表单设计实验报告_第3页
第3页 / 共4页
vfp表单设计实验报告_第4页
第4页 / 共4页
亲,该文档总共4页,全部预览完了,如果喜欢就下载吧!
资源描述

《vfp表单设计实验报告》由会员分享,可在线阅读,更多相关《vfp表单设计实验报告(4页珍藏版)》请在金锄头文库上搜索。

1、佛山科学技术学院实验报告实验名称 表单程序设计 实验项目 使用面向对象程序设计知识设计“计算器”程序 专业班级 姓名 学号 指导教师 王伟勤 成绩 日期 2009-11-5 一、实验目的 1了解面向对象程序设计的基本概念。 2掌握常用对象、属性、事件的使用。 3掌握对象的引用及用代码设置属性的方法。 4掌握普通表单的设计、调试和运行。 二、实验内容 设计如下图所示的计算器表单程序,并实现要求的功能。 要求:(1)可连续进行算术运算;(2)当输入新的数学式时,会自动清除文本框的原有内容;(3)当用户输入的数学式子有误时,可给出相应的提示,并要求重新输入,同 时使文本框获得焦点,并将原有内容反选。

2、三、设计步骤及相关按钮代码 建立一个 CommandGroup,按钮数为 16,然后编辑对象,排列按钮和调整按钮的大小,然 后在 Form 的 Init 行为新增声明和快捷对 16 个按钮的 Caption 进行修改: PUBLIC T T=“for i=1 to 9 mandgroup1.buttons(i).caption=alltrim(str(i) endfor mandgroup1.buttons(10).caption=“0“ mandgroup1.buttons(11).caption=“*“ mandgroup1.buttons(12).caption=“+“ mandgrou

3、p1.buttons(13).caption=“-“ mandgroup1.buttons(14).caption=“=“ mandgroup1.buttons(15).caption=“.“mandgroup1.buttons(16).caption=“/“ 然后统一在 CommandGroup 的 Click 行为部署各按钮相应的行为: do case case this.value=1 t=t+“1“ thisform.text1.value=t case this.value=2 t=t+“2“ thisform.text1.value=t case this.value=3 t=t+

4、“3“ thisform.text1.value=t case this.value=4 t=t+“4“ thisform.text1.value=t case this.value=5 t=t+“5“ thisform.text1.value=t case this.value=6 t=t+“6“ thisform.text1.value=t case this.value=7 t=t+“7“ thisform.text1.value=t case this.value=8 t=t+“8“ thisform.text1.value=t case this.value=9 t=t+“9“ th

5、isform.text1.value=t case this.value=10 t=t+“0“ thisform.text1.value=t case this.value=11 t=t+“*“ thisform.text1.value=t case this.value=12 t=t+ thisform.text1.value=t case this.value=13 t=t+- thisform.text1.value=t case this.value=14 thisform.text1.value=alltrim(str(&t,20,6)case this.value=15 t=t+. thisform.text1.value=t case this.value=16 t=t+/ thisform.text1.value=t endcase thisform.refresh 四、运行结果 见程序。 五、实验总结(调试分析和体会)

展开阅读全文
相关资源
正为您匹配相似的精品文档
相关搜索

最新文档


当前位置:首页 > 办公文档 > 其它办公文档

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号