Jak ktoś chce zmienić kolor progressbaru na taki jak w tej aplikacji
To udostępniam kod,ten kod wklejamy do przycisku gdzie mamy start timera,trójka w tym kodzie oznacza kolor progressbaru w tym przypadku kolor żółty,aby zmienić żeby kolor progressbaru był czerwony wystarczy za trójkę dać dwójkę.
SendMessage(ProgressBar1.Handle, 1040, 3, 0)
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
To wklejamy przed Public Class Form1
A tutaj daje cały kod aplikacji
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(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Timer1.Start() SendMessage(ProgressBar1.Handle, 1040, 2, 0) End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Timer2.Start() SendMessage(ProgressBar2.Handle, 1040, 3, 0) End Sub Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick ProgressBar1.Increment(1) If ProgressBar1.Value = 101 Then Timer1.Stop() End If End Sub Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick ProgressBar2.Increment(1) If ProgressBar2.Value = 101 Then Timer2.Stop() End If End SubEnd Class