Public Class Form1
Dim i = 0
Dim re = True
Private Sub Timer_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer.Tick
If i = 225 Then
re = False
ElseIf i = 0 Then
re = True
End If
If re = True Then
i += i
ElseIf re = False Then
i -= i
End If
color1.BackColor = Color.FromArgb(i, i, i)
End Sub
End Class
In this code, i want the label from black to white and then from white to black. I set the re var to indicate whether it is white, then i will reduce until the color to black. => Not works