拖一个Timer控件,再复制以下代码:
Private Sub Form_Load()
Timer1.Interval = 1000
Randomize
End Sub
Private Sub Timer1_Timer()
x = Me.Width / 2
y = (Me.Height - 420) / 2
rmax = IIf(x > y, y, x)
r = Int(Rnd * rmax)
Me.ForeColor = RGB(Int(Rnd * 256), Int(Rnd * 256), Int(Rnd * 256))
Circle (x, y), r
End Sub