by Gehan Fernando (47 Submissions)
Category: Custom Controls/Forms/Menus
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Mon 14th August 2006
Date Added: Mon 8th February 2021
Rating: (1 Votes)
Change Backcolour and Fill Colour In Progress Bar
API Declarations
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" _
(ByVal hwnd As Long, ByVal wMsg As Long, _
ByVal wParam As Integer, ByVal lParam As Any) As Long
Private Const PBM_SETBARCOLOR As Long = (WM_USER + 9)
Private Const CCM_SETBKCOLOR As Long = (CCM_FIRST + 1)
Private Const PBM_SETBKCOLOR As Long = CCM_SETBKCOLOR
Private Enum PrScrolling
Standard = 0
Smoth = 1
End Enum
Private Enum PrBarColor
DRed = vbRed
DGreen = vbGreen
DBlue = vbBlue
DBCustom = &HE76F0C
End Enum
Private Enum PrAppearance
ccFlat = 0
cc3D = 1
End Enum
With PB
.Appearance = Appr
.Scrolling = DScrolling
End With
SendMessage PB.hwnd, PBM_SETBARCOLOR, 0, BarColor
SendMessage PB.hwnd, PBM_SETBKCOLOR, 0, &HFFFFFF
End Sub