“高考倒计时”程序设计文档
一、 程序名称:高考倒计时
二、 程序功能
1:显示当前时间、高考时间、剩余时间
三、 程序设计
1:标签控件: Label1
2:文本控件: TextoreColor = &HFF0000
Label1(0).ToolTipText = " 单击可修改标题 "
nStr = Trim(GetSetting("xUnTime", "xOpt", "xTime", ""))
If nStr = "" Then ' 默认时间:为计算机当前年份的 6 月 7 日 Y = Format(Date, "yyyy")
I = DateDiff("s", Now, Y & "-6-7 9:00:00")
If I < 0 Then Y = Y + 1
nStr = Y & "-6-7 9:00:00"
End If
20: = nStr
True: = 1000
vbMaximized '最大化
End Sub
Private Sub Form_Unload(Cancel As Integer)
SaveSetting "xUnTime", "xOpt", "xCap", ctStr
SaveSetting "xUnTime", "xOpt", "xTime",
End Sub
Private Sub Label1_Click(Index As Integer)
用户修改标题
If Index <> 0 Then Exit Sub
Dim nStr As String
nStr = Trim(InputBox(" 请输入倒计时事件的标题: ", " 倒计时 - 设置标题 ", ctStr))
If Right(nStr, 3) = " 倒计时 " Then nStr = Trim(Left(nStr, Len(nStr) - 3))
If nStr = "" Then Exit Sub
ctStr = nStr
Call Form_Resize
End Sub
Private Sub Text1_Change()
Call Timer1_Timer
Call Form_Resize
End Sub
Private Sub Form_Resize()
Dim I As Long, H As Single, F As Single, W1 As Single
Dim S0 As Single, S1 As Single, S2 As Single, L1 As Single, L2 As Single
S0=0
S1 = 5 + LenB(StrConv(ctStr, vbFromUnicode))
If S1 < 9 Then S1 = 9
S2 = + LenB(StrConv, vbFromUnicode))
If S2 < Then S2 =
F=,,3)/(S0*2+S1
高考倒计时 来自淘豆网m.daumloan.com转载请标明出处.