# Wx::Gauge failed to set foreground colour using XP Style

**URL:** <https://www.ruby-forum.com/t/wx-gauge-failed-to-set-foreground-colour-using-xp-style/178653>\
**Category:** wxRuby\
**Created:** [November 9, 2009, 2:12am UTC](https://www.ruby-forum.com/t/wx-gauge-failed-to-set-foreground-colour-using-xp-style/178653 "2009-11-09T02:12:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![zzhan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/7cd45c/32.png) [@zzhan](https://www.ruby-forum.com/u/zzhan)\
**Post date:** [November 9, 2009, 2:12am UTC](https://www.ruby-forum.com/t/wx-gauge-failed-to-set-foreground-colour-using-xp-style/178653/1 "2009-11-09T02:12:31Z")

</div>

My application has a Wx::Gauge, its colour is changeable via  
set\_foreground\_colour method.

After I updated the ruby.exe.manifest to use XP Styles,  
([Ruby on Windows: Windows XP Visual Style Controls with wxRuby](http://rubyonwindows.blogspot.com/2007/10/windows-xp-visual-style-controls-with.html)),  
the gauge’s foreground stays Green always without code changes.

I think this might not be anything to do with WxRuby or WxWidget, but  
wondering whether any tricks there to enable changing Gauge colours with  
XP styles.

Thanks,  
Zhimin

---

<div class="post-metadata">

**Author:** ![zzhan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/7cd45c/32.png) [@zzhan](https://www.ruby-forum.com/u/zzhan)\
**Post date:** [November 9, 2009, 11:14am UTC](https://www.ruby-forum.com/t/wx-gauge-failed-to-set-foreground-colour-using-xp-style/178653/2 "2009-11-09T11:14:49Z")

</div>

On Mac OS X, and Windows XP, when native styles are used (EG: Windows XP  
using Win 95/98 styles, and not XP Styles), it is impossible to change  
the  
color of the Progress Bar, or some other controls. As you thought, this  
isn’t a wxRuby or wxWidgets failing, but the native OS’ inflexibility to  
allow changes to certain controls.

The only other suggestion that I can make, is to create your own custom  
control, and use bitmaps, or what have ya to custom draw the progress  
bar  
you want. Take a look at some HTML/CSS/JavaScript Examples of Progress  
Bars, to get an idea of how you can start with creating your own custom  
Progress Bar.

hth,  
Mario

---

<div class="post-metadata">

**Author:** ![zzhan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/7cd45c/32.png) [@zzhan](https://www.ruby-forum.com/u/zzhan)\
**Post date:** [November 9, 2009, 11:09pm UTC](https://www.ruby-forum.com/t/wx-gauge-failed-to-set-foreground-colour-using-xp-style/178653/3 "2009-11-09T23:09:53Z")

</div>

Mario,

Thanks for your explanation and suggestion!

Regards,  
Zhimin
