Programación VB: gradiente dinámico de colores
Sub privado Form_Load()
Timer1.Interval = 10
Fin Sub
Sub Timer1_Timer() privado
Estático i como entero
Estático j como byte
i = i + 1
'Label1 = i & " " & j
Si i < 255 Entonces
Si j = 0 Entonces
Label1.BackColor = RGB(255 - i, 255, 255)
ElseIf j = 1 Entonces
Etiqueta1.BackColor = RGB(255, 255 - i, 255)
ElseIf j = 2 Entonces
Etiqueta1.BackColor = RGB(255, 255, 255 - i)
ElseIf j = 3 Entonces
j = j - 3
Fin si
ElseIf i >= 255 Entonces
j = j + 1
i = i - 256
Fin si
Fin Sub