Groupbox text is always blue

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am putting a groupbox in various forms but its text is always blue. It
doesn't matter which form I put it on and its background color. Does anyone
know how I can specify color that I want for the title text of a groupbox?
I'm using VS 2005.
 
Hello Steve,

This behaviour could be if you change the standard windows colors (or apply
some schemas)
See there the sample of how to draw custom groupbox http://www.codeproject.com/useritems/grouper.asp

ST> I am putting a groupbox in various forms but its text is always
ST> blue. It doesn't matter which form I put it on and its background
ST> color. Does anyone know how I can specify color that I want for the
ST> title text of a groupbox? I'm using VS 2005.
ST>
---
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
 
Steve,

This happens because the visual styles are enabled for .NET 2.0 by default.
if you want to turn them off you need to go in the application main method
(it is in Program.cs file) and delete the line
Application.EnableVisualStyles() line. This will turn off the visual styles
for all applicationa and you'll get a classic win2k look and feel.

In .NET 1.x this can be controlled per control if the control supports
FlatStyle property (group box does). Unfortunately in .NET 2.0 this has no
effect; you either get visual styles for the whole application or nothing.
 
Back
Top