vf中改变label的字体的颜色用什么时间代码
1个回答
展开全部
做个时间控件设定时间
加入代码
Private Sub Timer1_Timer()
Chc Label1, 1, 3, 5, 8, 10, 12, 14
End Sub
Sub Chc(Cont As Control, Color1 As Integer, Color2 As Integer, Color3 As Integer, Color4 As Integer, Color5 As Integer, Color6 As Integer, Color7 As Integer)
If Val(Cont.Tag) = Color1 Then
Cont.Tag = Color2
ElseIf Val(Cont.Tag) = Color2 Then
Cont.Tag = Color3
ElseIf Val(Cont.Tag) = Color3 Then
Cont.Tag = Color4
ElseIf Val(Cont.Tag) = Color4 Then
Cont.Tag = Color5
ElseIf Val(Cont.Tag) = Color5 Then
Cont.Tag = Color6
ElseIf Val(Cont.Tag) = Color6 Then
Cont.Tag = Color7
ElseIf Val(Cont.Tag) = Color7 Then
Cont.Tag = Color1
Else
Cont.Tag = Color1
End If
Cont.ForeColor = QBColor(Cont.Tag)
End Sub
加入代码
Private Sub Timer1_Timer()
Chc Label1, 1, 3, 5, 8, 10, 12, 14
End Sub
Sub Chc(Cont As Control, Color1 As Integer, Color2 As Integer, Color3 As Integer, Color4 As Integer, Color5 As Integer, Color6 As Integer, Color7 As Integer)
If Val(Cont.Tag) = Color1 Then
Cont.Tag = Color2
ElseIf Val(Cont.Tag) = Color2 Then
Cont.Tag = Color3
ElseIf Val(Cont.Tag) = Color3 Then
Cont.Tag = Color4
ElseIf Val(Cont.Tag) = Color4 Then
Cont.Tag = Color5
ElseIf Val(Cont.Tag) = Color5 Then
Cont.Tag = Color6
ElseIf Val(Cont.Tag) = Color6 Then
Cont.Tag = Color7
ElseIf Val(Cont.Tag) = Color7 Then
Cont.Tag = Color1
Else
Cont.Tag = Color1
End If
Cont.ForeColor = QBColor(Cont.Tag)
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询