Public Sub op_Sub()
MPl.Play
Select Case op
Case "+"
e = Str(Val(e) + Val(f))
f = ""
Case "-"
e = Str(Val(e) - Val(f))
f = ""
Case "*"
e = Str(Val(e) * Val(f))
f = ""
Case "/"
e = Str(Val(e) / Val(f))
f = ""
Case "^"
e = Str(Val(e) ^ Val(f))
f = ""
End Select
End Sub
二、提示信息模块相关代码:
Option Explicit
Private Const SWP_NOMOVE = 2
Private Const SWP_NOSIZE = 1
Private Const FLAGS = SWP_NOMOVE Or SWP_NOSIZE
Private Const HWND_TOPMOST = -1
Private Const HWND_NOTOPMOST = -2
Const HTCAPTION = 2
Const WM_NCLBUTTONDOWN = &HA1
Private Declare Function ReleaseCapture Lib "user32" () As Long
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Long) As Long
' 内存中的提示数据库。
Dim Tips As New Collection
' 提示文件名称
Const TIP_FILE = "TIPOFDAY.TXT"
' 当前正在显示的提示集合的索引。
Dim CurrentTip As Long
Private Sub DoNextTip()
If Op1.Value = 1 Then
' 随机选择一条提示。
CurrentTip = Int((Tips.Count * Rnd) + 1)
Else
' 或者,您可以按顺序遍历提示
CurrentTip = CurrentTip + 1
If Tips.Count < CurrentTip Then
CurrentTip = 1
End If
End If
' 显示它。
frmTip.DisplayCurrentTip
End Sub
Function LoadTips(sFile As String) As Boolean
Dim NextTip As String ' 从文件中读出的每条提示。
Dim InFile As Integer ' 文件的描述符。
' 包含下一个自由文件描述符。
InFile = FreeFile
' 确定为指定文件。
上一页 [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] 下一页