vb我编的电子日历就是不行呢
PrivateSubTimer1_Timer()DimTAsString,WAsIntegerDimP1AsInteger,P2AsIntegerLabel1=Year(...
Private Sub Timer1_Timer()
Dim T As String, W As Integer
Dim P1 As Integer, P2 As Integer
Label1 = Year(Date)
Label3 = Month(Date)
Label5 = Day(Date)
T = Time
P1 = 1
P2 = InStr(T, ":")
Label7 = Mid(T, P1, P2 - P1)
P1 = P2 + 1
P2 = InStr(P1, T, ":")
Label10 = Val(Mid(T, P1, P2 - P1))
P1 = P2 + P1
Label11 = Val(Mid(T, P1))
W = Weekday(Date, vbMonday)
Label6 = Format(Weekday(Date, 0), "dddd")
If W = 7 Or W = 6 Then
Label6.ForeColor = vbRed
Label5.ForeColor = vbRed
Else
Label6.ForeColor = vbBlack
Label5.ForeColor = vbBlack
End If
End Sub 展开
Dim T As String, W As Integer
Dim P1 As Integer, P2 As Integer
Label1 = Year(Date)
Label3 = Month(Date)
Label5 = Day(Date)
T = Time
P1 = 1
P2 = InStr(T, ":")
Label7 = Mid(T, P1, P2 - P1)
P1 = P2 + 1
P2 = InStr(P1, T, ":")
Label10 = Val(Mid(T, P1, P2 - P1))
P1 = P2 + P1
Label11 = Val(Mid(T, P1))
W = Weekday(Date, vbMonday)
Label6 = Format(Weekday(Date, 0), "dddd")
If W = 7 Or W = 6 Then
Label6.ForeColor = vbRed
Label5.ForeColor = vbRed
Else
Label6.ForeColor = vbBlack
Label5.ForeColor = vbBlack
End If
End Sub 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询