关于VB中窗口背景色

2025-03-13 20:35:48
推荐回答(2个)
回答1:

Private Sub Form_Load()
Timer1.Interval = 30
Timer1.Enabled = True
End Sub

Private Sub Timer1_Timer()
Static c As Integer, f As Integer
If c = 0 Then f = 1
If c = 256 Then f = -1
c = c + f
Me.BackColor = RGB(c, 0, 256 - c)
End Sub

以上代码需要用到一个控件:Timer1

回答2:

是动画变色还是像word填充颜色的渐变?