Private Sub Command1_Click()
Cls
For i = 1 To 9
For j = 1 To i
Print Tab((j - 1) * 10);
Print j & "x" & i & "=" & i * j;
Me.ForeColor = RGB(Rnd * 255, Rnd * 255, Rnd * 255)
Next j
Print
Next i
End Sub
Private Sub Timer1_Timer()
Me.ForeColor = RGB(Rnd * 255, Rnd * 255, Rnd * 255)
End Sub以上是我的代码。颜色是彩色的 但是不会随机变色。求高人看看那里出错了。
VB怎么用时钟使窗口文字随机变色
答案:1 悬赏:10 手机版
解决时间 2021-02-04 09:57
- 提问者网友:浪荡绅士
- 2021-02-03 16:51
最佳答案
- 五星知识达人网友:行雁书
- 2021-02-03 17:23
Private Sub Command1_Click()
Cls
Command1.Caption = IIf(Command1.Caption = "开始", "暂停", "开始")
If Command1.Caption = "暂停" Then
Timer1.Enabled = True
Timer1.Interval = 200
ElseIf Command1.Caption = "开始" Then
Timer1.Interval = 0
End If
End Sub
Private Sub Form_Load()
Command1.Caption = "开始"
Timer1.Interval = 200
Timer1.Enabled = False
End Sub
Private Sub Timer1_Timer()
Cls
a = a - 100
If a + TextWidth(s) < 0 Then a = Me.ScaleWidth
CurrentX = a
CurrentY = 500
Me.ForeColor = QBColor(Int(Rnd * 15))
Print s
End Sub
你要的重点就在 TIMER1 事件里
Cls
Command1.Caption = IIf(Command1.Caption = "开始", "暂停", "开始")
If Command1.Caption = "暂停" Then
Timer1.Enabled = True
Timer1.Interval = 200
ElseIf Command1.Caption = "开始" Then
Timer1.Interval = 0
End If
End Sub
Private Sub Form_Load()
Command1.Caption = "开始"
Timer1.Interval = 200
Timer1.Enabled = False
End Sub
Private Sub Timer1_Timer()
Cls
a = a - 100
If a + TextWidth(s) < 0 Then a = Me.ScaleWidth
CurrentX = a
CurrentY = 500
Me.ForeColor = QBColor(Int(Rnd * 15))
Print s
End Sub
你要的重点就在 TIMER1 事件里
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯