如题,万分感谢
解决方案 »
- 急急i
- 再次讨论水晶报表的文件导出功能
- picturebox 问题
- 求助Public fMainForm As frmMain出来类型未定义错误
- 高手:请问如何实现改变无标题栏的窗口大小!!!!!!!!!!!!!!!
- 垂直滚动条.Max = rs.RecordCount'记录总数 问题:垂直滚动条.Value = DataGrid1获得焦点的行数,怎样获得DataGrid1的行焦点的变化?(
- 如何通过文件的扩展名获取系统的图标,请教!!急~~~~
- VB6反编译
- 怎样跳出IF循环,执行前面的代码?
- 为什么 W2K PROFESSIONAL下不能连接到SQL SERVER?
- 我想要用VBA来实现一个VLOOKUP查询-在线等候
- 一些专用的符号,如何在程序中调用、输出?
Dim sum As Long
Dim sum1 As Long
Private Sub Form_Load()
sum1 = 59
sum = 60
Timer1.Interval = 500
End SubPrivate Sub Timer1_Timer()
If lbltime.Caption <> CStr(Time) Then
sum = sum - 1
Text1 = "倒计时" & sum1 & ":" & sum
If sum <= 0 Then
sum = 60
sum1 = sum1 - 1
If sum1 <= 0 Then
MsgBox ("时间到")
Timer1.Enabled = False
End If
End If
End If
End Sub
Const Totaltime = 60
Private Sub Command1_Click()
Timer1.Enabled = True
End SubPrivate Sub Form_Load()
Timer1.Interval = 500
Timer1.Enabled = False
Label1.Caption = ""
End SubPrivate Sub Timer1_Timer()
Static i As Integer
Dim sum As Long
Label1.Caption = "考试时间还剩" & Totaltime - i \ 120 & "分钟"
i = i + 1
If Totaltime - i \ 120 <= 0 Then
MsgBox ("时间到")
Timer1.Enabled = False
End If
End Sub
Private Declare Sub Sleep Lib "kernel32.dll" (ByVal dwMilliseconds As Long)
Private State As BooleanPrivate Sub Label1_Click()
Dim preT As Date, curT As Long
If State Then
State = False
Exit Sub
End If
State = True
preT = DateAdd("h", 1, Time)
Do
curT = DateDiff("s", Time, preT)
Label1.Caption = Format((curT \ 3600 & ":" & (curT Mod 3600) \ 60 & ":" & (curT Mod 3600) Mod 60), "HH:MM:SS")
DoEvents
Sleep (500)
DoEvents
If Val(curT) < 0 Or Not State Then
Label1.Caption = "stop" '开始考试
Exit Sub
End If
Loop
End Sub
Dim PauseTime, Start, Finish, TotalTime
Dim t As Integer
Dim a As Integer
If (MsgBox("点击开始考试", 4)) = vbYes Then
PauseTime = 3600 ' 设置暂停时间。
Start = Timer ' 设置开始暂停的时刻。
CommandButton1.Caption = "考试已经开始了0分钟"
MsgBox "ok"
a = 0
Do While Timer < Start + PauseTime
' 将控制让给其他程序。
Finish = Timer ' 设置结束时刻。
TotalTime = Finish - Start ' 计算总时间。
t = TotalTime / 60
If a < t Then
a = t
CommandButton1.Caption = "考试时间已经过去了" + Str(a) + "分钟"
MsgBox a
End If
Loop
Else
End
End If这个代码没问题,但好像在PPT里MsgBox函数不行,点击开始考试没反应