文档详情

课程设计添加表单(6个课时).doc

发布:2016-05-23约字共4页下载文档
文本预览下载声明
添加表单(添加.scx) 表单对象结构组成:一个页框(含有5页)、一个命令按钮。 属性设置: 对象 属性 属性值 备注 Form1 Caption 添加 autocenter .T. Command1 caption 返回 Pageframe1 pagecount 5 (包含下面5页) Page1 Caption 学生表 Page2 Caption 教师表 Page3 Caption 班级表 Page4 Caption 课程表 Page5 Caption 成绩表 事件设置:  命令按钮command1(返回)的click事件代码:  thisform.Release 表单form1的load事件代码: for i=1 to 10 select i use endfor 数据环境设置: 将“选课成绩管理.Dbc”数据库中的student、score、classes、course、teacher表添加到数据环境中。 1、第一页(学生表) 1)对象结构图: 结构组成:标签、形状、文本框、命令按钮组。 2)Page1中对象及属性设置: 对象 属性 属性值 Label1 Caption 向学生表添加新记录 Commandgroup1 buttoncount 2 Command1 caption 添加 Command2 caption 重写 Shape1 Backstyle 0-透明 3)text4的生成器设置:  将生成器“格式”标签中的“数据类型”设置为“日期型”。(切记!!!) 4)Pageframe1.Page1中对象的事件代码 commandgroup1的click事件代码: if this.value=1 public n1,n2,n3,n4,n5 n1=alltrim(this.parent.text1.value) n2=alltrim(this.parent.text2.value) n3=alltrim(this.parent.text3.value) n4=this.parent.text4.value n5=alltrim(this.parent.text5.value) if n1== messagebox(学号不能空!,64,提示) this.parent.text1.value= this.parent.text2.value= this.parent.text3.value= this.parent.text4.value={} this.parent.text5.value= this.parent.text1.setfocus else sele student go bottom insert into student values(n1,n2,n3,n4,n5) messagebox(添加成功!,64,提示) this.parent.text1.value= this.parent.text2.value= this.parent.text3.value= this.parent.text4.value={} this.parent.text5.value= this.parent.text1.setfocus endif else this.parent.text1.value= this.parent.text2.value= this.parent.text3.value= this.parent.text4.value={} this.parent.text5.value= this.parent.text1.setfocus endif 2、第二页(教师表) 1)对象结构图: 结构组成:标签、形状、文本框、命令按钮组、编辑框。 2)Page2中对象及属性设置: 对象 属性 属性值 Label1 Caption 向教师表添加新记录 Commandgroup1 buttoncount 2 Command1 caption 添加 Command2 caption 重写 Shape1 Backstyle 0-透明 3)text4的生成器设置:  将生成器“格式”标签中的“数据类型”设置为“日期型”。(切记!!!) 4)Pageframe1.Page2中对象的事件代码 命令按钮组commandgroup1的click事件代码: if this.value=1 n1=alltrim(this.parent.text1.value) n2=alltrim(this.parent.text
显示全部
相似文档