Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. Unable to change default color of Progress Bar control in winforms

Unable to change default color of Progress Bar control in winforms

Scheduled Pinned Locked Moved C#
csharpwinforms
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    superselector
    wrote on last edited by
    #1

    Why the default color green is not changed for progress bar control even though if change the forecolor property value to something else.it is always green by default.

    A L 2 Replies Last reply
    0
    • S superselector

      Why the default color green is not changed for progress bar control even though if change the forecolor property value to something else.it is always green by default.

      A Offline
      A Offline
      Abhinav S
      wrote on last edited by
      #2

      You cannot set the color unless you remove the line Application.EnableVisualStyles(); from the main file. This line enables the default windows color on your application. Note that removing this line will have an impact on the entire form.

      Apps - Color Analyzer | Arctic | XKCD | Sound Meter | Speed Dial

      1 Reply Last reply
      0
      • S superselector

        Why the default color green is not changed for progress bar control even though if change the forecolor property value to something else.it is always green by default.

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        superselector wrote:

        Why

        From the documentation[^];

        ForeColor and BackColor changes for the ProgressBar will not be honored when visual styles are enabled on Windows XP Home Edition, Windows XP Professional, Windows Server 2003 and above.

        You'd could paint your own progressbar, or try one the articles here on CodeProject.

        Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^]

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups