Results 1 to 5 of 5

Thread: progress bar color properties?

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 2006
    Posts
    2

    progress bar color properties?

    Is there a way to add color to the progress bar control ? Like adding fill color and background color and shading?

  2. #2
    "Digital Revolution"
    Join Date
    Mar 2005
    Posts
    4,471

    Re: progress bar color properties?

    I think you can change it using API, but I would rather use one like this:

    http://www.pscode.com/vb/scripts/Sho...56151&lngWId=1

  3. #3
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: progress bar color properties?

    If just a color change is all you want then its just a couple of lines of code plus you dont have the extra ocx to distribute with your app.
    VB Code:
    1. Private Declare Function SendMessageLong Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, _
    2. ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
    3.  
    4. Private Const PBM_SETBARCOLOR As Long = &H409
    5. Private Const PBM_SETBKCOLOR As Long = &H2001
    6.  
    7. 'USE
    8. Call SendMessageLong(prbStatus.hwnd, PBM_SETBARCOLOR, 0&, vbRed)
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  4. #4
    Hyperactive Member Hassan Basri's Avatar
    Join Date
    Sep 2006
    Posts
    324

    Re: progress bar color properties?

    I have used this Progress Bar Class (no ocx to ship with your application) from vbaccelerator. It gives you full control of the progress bar as well as extra features (like xp theme). It draws the progress bar on a picturebox.

    http://www.vbaccelerator.com/home/vb...ss/article.asp

  5. #5

    Thread Starter
    New Member
    Join Date
    Nov 2006
    Posts
    2

    Re: progress bar color properties?

    Hello Hassan, Thank you very much for your help! I am new at vb and appreciate your help. I will practice with your code. I can't believe Microsoft didn't design the progress control to be able to have fill colors and background colors on it like most of the rest of the controls. Why do you think they did that? Almost every download I see has a real nice colored progress bar to let you know it is downloading.

    Thanks again. Ira Lavender ([email protected])

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width