Setting FlatStyle to System causes the control to use the current
System.Colors. In order to use your own colors and apply Visual Styles you
must OwnerDraw the control. I have written a Button control which Inherits
from button and allows you to Apply Visual Styles with the FlatStyle set to
Standard. As well as still using your choice of ForeColor, it allows you to
use the Image. You can find this controls SourceCode at:
<www.planetsourcecode.com/vb/scripts/ShowCode.asp?txtCodeId=1900&lngWId=10>
I used a complicated method to draw the background and have since discovered
the DrawThemeParentBackground API call which does that for you, but I will
not be updating the source as the method I used shows how to test for a
property in another control and that could be beneficial.
You can use this example as a guide to create other controls which behave
similarly.
"Bernie Yaeger" <be*****@cherwellinc.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
When you use xp styles
Application.EnableVisualStyles()
Application.DoEvents()
and you change a control's flat style to 'system', you then are not able
to set the control's forecolor, or if you did set it, it reverts to the
default forecolor. Any way to change the forecolor even if xp styles are on and
the flat style is system?
Thanks for any help.
Bernie Yaeger