当前位置:编程学习 > VB >>

求一个可以背英语单词的vb小程序

本系统功能要求:
1. 能够自动显示单个单词中英文及词性。
2. 显示单个单词的时间可以调整,并随时显示已用时间。
3. 有暂停功能。
4. 可用文本文件存储单词。
--------------------编程问答--------------------
'单词内容一条一行存放在 C:\temp\dict.txt 中
'窗体上放以下控件:
'Label1 显示单词用
'Text1 输入间隔毫秒数
'Command1 开始
'Command2 暂停
'Timer1 定时器
Option Explicit

Private m_hFile As Integer

Private Sub Command1_Click()
    Timer1.Interval = Val(Text1.Text)
    Timer1.Enabled = True
End Sub

Private Sub Command2_Click()
    Timer1.Enabled = False
End Sub

Private Sub Form_Load()
    m_hFile = FreeFile()
    Open "C:\temp\1.txt" For Input Access Read As #m_hFile
End Sub

Private Sub Form_Unload(Cancel As Integer)
    Close #m_hFile
End Sub

Private Sub Timer1_Timer()
    Dim sLine As String
    
    If EOF(m_hFile) Then
        Seek #m_hFile, 1
    End If
    
    Line Input #m_hFile, sLine
    Label1 = sLine
End Sub
--------------------编程问答-------------------- 谢了,可否给一个联系方式。比如qq --------------------编程问答-------------------- 有点意思 --------------------编程问答-------------------- 无QQ --------------------编程问答-------------------- Private Sub Timer1_Timer()
    Dim sLine As String
    
    If EOF(m_hFile) Then
        Seek #m_hFile, 1
    End If
    
    Line Input #m_hFile, sLine
    Label1 = sLine
End Sub


这部分编译错误,过程声明,与同名事件或过程的描述不匹配 --------------------编程问答-------------------- 编译、运行都通过的! --------------------编程问答-------------------- 哦,似乎明白了,我试试,谢 --------------------编程问答-------------------- 网上有现成的代码!好像叫《英语100句》是源码!很不错!LZ可以到网上找找。 --------------------编程问答-------------------- Option Explicit

Private m_hFile As Integer

Private n As Long
Private Sub Command1_Click()
    Timer1.Interval = Val(Text1.Text)
    Timer1.Enabled = True
    Timer2.Interval = 10
    Timer2.Enabled = True

End Sub

Private Sub Command2_Click()
    Timer1.Enabled = False
    Timer2.Enabled = False

End Sub

Private Sub Form_Load()
    m_hFile = FreeFile()
    Open "C:\temp\dict.txt" For Input Access Read As #m_hFile
End Sub

Private Sub Form_Unload(Cancel As Integer)
    Close #m_hFile
End Sub

Private Sub Timer1_Timer()
    Dim sLine As String
    
    If EOF(m_hFile) Then
        Seek #m_hFile, 1
    End If
    
    Line Input #m_hFile, sLine
    Label1 = sLine
End Sub


Private Sub Timer2_Timer()
    Cls
    n = n + 1
    Print "已用时间:" & Format(n / 6000, "00.00")
End Sub


这是我修改的代码,最后的代码有问题,时间总是闪,怎么改一下?

--------------------编程问答-------------------- 放电影只要 24帧/秒,你的时间刷新有 100帧/秒,太快就会闪。
建议改成 25帧/秒,容易整除。
补充:VB ,  资源
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,