The WinForms ProgressBar control allows its foreground color to be set. While this normally works fine, the foreground color setting seems to be ignored on XP when using the obnoxious Luna style: it is always green.
Similaraly, XP Luna seems to ignore the ‘Style’: Although I have set it to ‘Continuous’, the progress bar is always drawn with blocks.
Is this supposed to be correct behavior? Is there a way to work around this?
To disable the Luna visual style, you can remove the call to Application.EnableVisualStyles() in the auto-generated Program class.
This will make all controls on forms created after that point to look like Windows 2000.
You can conditionally call it depending on the OS, since Vista’s visual styles respect the Style property, IIRC (can’t test right now – my laptop died).
You can handle the rendering of the control manually via the Paint event or by deriving from the control and overriding OnPaint*().
You could also roll your own from scratch, since progress bars are rather simple.