新建From1(窗体),新建Label1(Label),Timer1(Timer),代码:
Private Sub Form_Load()
Label1.Top = 1850 '设置闪烁字体的显示位置
Label1.Left = Screen.Width / 8
Timer1.Interval = 500 '设置字体闪烁间隔时间
Command1.Top = Screen.Height / 1.5 '设置按钮在窗体中的位置
Command1.Left = Screen.Width / 2
Form1.WindowState = 2 '设置窗体最大化
End Sub
'循环地改变字体颜色 (ForeColor)
Private Sub s_change_color(Cont As Control, Color1 As Integer, Color2 As Integer, Color3 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 = Color1
Else
Cont.Tag = Color1
End If
Cont.ForeColor = QBColor(Cont.Tag)
End Sub
'利用计时器控件Timer有规律地改变字体颜色 (ForeColor)
Private Sub Timer1_Timer()
s_change_color Label1, 2, 6, 12
End Sub