Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Progress Bar

Status
Not open for further replies.

CleoMan

Programmer
Joined
Jun 18, 2003
Messages
110
Location
ZA
Alright, how do I change the color of the bar in a progress bar to black. I have tried everything so any help would be appreciated on this one.

 
Its a common complaint, I dont think you can.

In case I ever needed it I bookmarked an interesting item in MSDN that talks about creating lightweight controls. By coincidence as an example it gives the code to create your own (improved) progress bar - I must try it one day. The topic title is "Conserve System Resources with Lightweight Controls" by Todd Ryan



 

Option Explicit
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long

Private Const WM_USER = &H400
Private Const PBM_SETBARCOLOR = (WM_USER + 9)

Private Sub Form_Load()
SendMessage ProgressBar1.hwnd, PBM_SETBARCOLOR, 0, ByVal vbBlack
End Sub
 
You can also down load a free progress bar control from the common controls replacement project ( It has many more features than the standard progress bar, including the ability to set the colour of the bar, and is downloaded with a sample project.

Thanks and Good Luck!

zemp
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top