admin 管理员组

文章数量: 1086019


2024年4月19日发(作者:元素同位素表)

课程设计报告

课程设计题目:简单记单词

业:

级:

号:

1

学生姓名

指导教师

2011年05 月21日

目 录

第一章 算法分析…………………………………( 3-6 )

第二章 工作日志…………………………………( 7 ).

第三章 关键实现技术……………………………( 7 )

第四章 设计小结…………………………………( 7 )

2

第一章 算法分析

建立两个窗体form1,form2

Form1各控件属性设置如下表:

控件 属性(属性值)

窗体

框架

文本框

命令按钮

命令按钮

Form1窗体设计如下图:

Name(form1)

Name(frame1)

Name(wordtxt)

Name(command1)

Name(command2)

属性(属性值)

Caption(单词录入框)

Caption()

Text()

Caption(添加)

Caption(完成)

属性(属性值)

MultiLine(true)

Form1代码如下:

Private Sub Command1_Click()' 所要记忆的单词内容

Open "d:" For Output As #1 '把单词写入一个名为“”的文件中

For i = 1 To Len()

Print #1, Mid(, i, 1);

Next i

Close #1

3

End Sub

控件

窗体

框架1

框架2

标签1

标签2

标签3

标签4

标签5

命令按钮1

命令按钮2

命令按钮3

命令按钮4

命令按钮5

组合框1

组合框2

文本框

时钟

通用对话框

属性(属性值)

Name(form2)

Name(frame1)

Name(frame2)

Name(Label1)

Name(Label2)

Name(Label3)

Name(Label4)

Name(Label5)

Name(command1)

Name(command2)

Name(command3)

Name(command4)

Name(command5)

Name(combo1)

Name(combo2)

Name(Text1)

Name(Timer1)

Name(CommonDialog)

属性(属性值)

Caption(单词记忆框)

Caption(记忆单词)

Caption(设置)

Caption(选择记忆时间间隔)

Caption(秒)

Caption()

Caption(字体)

Caption(字号)

Caption(开始/继续)

Caption(暂停)

Caption(结束)

Caption(恢复默认字体)

Caption(背景色)

Text()

Text()

Text()

Interval(0)

属性(属性值)

Enable(False)

Private Sub Command2_Click() '完成单词的录入,跳转到记忆单词的过程

e = False

e = True

End Sub

Form2窗体各控件属性设置如下表:

Form窗体设计如下图:

4

Form2代码如下:

Option Explicit

Dim color As Long

Private file1 As Integer

Private Sub Combo1_Change()'输入字体的处理过程

me =

End Sub

Private Sub Combo1_Click()'选择字体的单击事件过程

me =

End Sub

Private Sub Combo2_Change()'输入字号的处理过程

ze = Val()

End Sub

Private Sub Combo2_Click()' 选择字号的单击事件过程

ze = Val()

End Sub

Private Sub Command1_Click()'开始/继续单词显示

al = Val() * 1000

d = True

5

End Sub

Private Sub Command2_Click()'暂停单词显示

d = False

End Sub

Private Sub Command3_Click()'结束单词记忆

End

End Sub

Private Sub Command4_Click()'选择Label3的背景色

lor

color =

lor = color

End Sub

Private Sub Command5_Click()'Label3上显示的单词的字体

me = "宋体"

ze = 10

= "宋体"

= Str(10)

End Sub

Private Sub Form_Load()

Dim i As Integer

m "宋体"

m "黑体"

m "幼圆"

m "隶书"

m "楷体_gb2312"

For i = 8 To 30 Step 2'初始化字号组合框

m Str(i)

Next i

me = "宋体"'始化设置标签与组合框

ze = 10

= "宋体"

= Str(10)

file1 = FreeFile()

Open "d:" For Input Access Read As #file1

d = False

End Sub

Private Sub Timer1_Timer()

Dim putword As String

6

If EOF(file1) Then

Seek #file1, 1

End If

Line Input #file1, putword '一行一行的读

Label3 = putword

End Sub

第二章 工作日志

5月17日:单词的录入问题。

解决方法:从课本中寻求相似例题,最后确定初步思路。

5月18日:运行完Form1后,无法跳转到Form2继续运行。

解决方法:设置一个命令按钮利用Visible属性,使Form1运行完后Form1的Visible为False,Form2的Visible为True。

5月19日:控制单词显示时间的问题。

解决方案:Timer1的Interval属性设置为0,然后在“开始/继续”命令按钮的源代码中写al = Val() * 1000就

可以了。

第三章 关键实现技术

7

Timer控件的使用合理运用,录入的时候一行一行录入,记忆单词阶段再按一行一行读就能实现单词一个个出现的频率。

第四章 设计小结

通过这次的课程设计,我得到了许多经验,比如说设计思路的选择,界面的设计,过程中所遇到的问题要用什么样的方法

去解决。同时也发现自己学习方面还有很多不足。VB是一个很强大的计算机语言,通过这次的VB课程设计,我感觉对于

我的VB的学习受益匪浅。

8


本文标签: 单词 属性 记忆 录入 选择