1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
| Dim r As Integer = 244
Dim g As Integer = 65
Dim b As Integer = 65
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Me.BackColor = Color.FromArgb(244, 66, 66)
End Sub
Private Sub Timerr_Tick(sender As Object, e As EventArgs) Handles Timerr.Tick
If b >= 244 Then
r -= 1
Me.BackColor = Color.FromArgb(r, g, b)
End If
If r <= 65 Then
Timerr.Stop()
Timerg.Start()
End If
If r >= 244 Then
Timerr.Stop()
Timerg.Start()
End If
If b <= 65 And r < 244 Then
r += 1
Me.BackColor = Color.FromArgb(r, g, b)
End If
End Sub
Private Sub Timerg_Tick(sender As Object, e As EventArgs) Handles Timerg.Tick
If r <= 65 And g < 244 Then
g += 1
Me.BackColor = Color.FromArgb(r, g, b)
End If
If g >= 244 Then
Timerg.Stop()
Timerb.Start()
End If
If r >= 244 Then
g -= 1
Me.BackColor = Color.FromArgb(r, g, b)
End If
If g <= 65 Then
Timerg.Stop()
Timerb.Start()
End If
End Sub
Private Sub Timerb_Tick(sender As Object, e As EventArgs) Handles Timerb.Tick
If b >= 244 Then
Timerb.Stop()
Timerr.Start()
End If
If g <= 65 And b < 244 Then
b += 1
Me.BackColor = Color.FromArgb(r, g, b)
End If
If g >= 244 Then
b -= 1
Me.BackColor = Color.FromArgb(r, g, b)
End If
If b <= 65 Then
Timerb.Stop()
Timerr.Start()
End If
End Sub |
Partager