vb.net ProgressBar1 color

VNote 2017.07.15 14:52:57 *: Public Class Form1
Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Integer, ByVal wMsg As Integer, ByVal wParam As Integer, ByVal lParam As Integer) As Integer


Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load

' the next line is the one which will change the progressbar color

' you can use 3 numbers instead of using the number "2", which will make the progress bar red, you can use 1 to green and 3 to yeallow

SendMessage(ProgressBar1.Handle, 1040, 2, 0)

Timer1.Start()



End Sub

Private Sub Timer1_Tick(sender As System.Object, e As System.EventArgs) Handles Timer1.Tick
ProgressBar1.Increment(10)
If ProgressBar1.Value = 100% Then
ProgressBar1.Value = 0

End If
End Sub
End Class

ProgressBar1.ForeColor = Color.Aqua