Controls And Colors

R

Richard

All,

In my Windows based .NET C# application I tried to change
a form's background color to non-gray. The form backround
color change had the desired ripple effect for most
controls on the form however it had no effect, and is a
problem, for:

- a TabControl {not a tabpage - the tabcontrol itself}
- the scroll bars of a Datagrid
- the buttons of a combobox

I got frustrated enough with this problem that I wrote a
recursive loop to set the foreground and background colors
of every control {and their children} to the same color.
The loop worked - except for the controls listed above -
any ideas?

Also, while attempting to beat this problem I tried to be
sneaky and redefine the SystemColors settings for the
form --> only to discover that I can't find an API to
alter the system color pallette at either the application
or, prefereably, the form level. Is there a way to change
the SystemColors pallete on a per form {or at least a per
application} basis?

--Richard
 
V

Val Savvateev

Yeah, this type of problems are inherited, they come from Windows OS
controls themselves.... To kind of give you an idea - combobox's button is
not a control (not a window), for example, - this little naughty thing just
gets painted....

Also I'm afraid that API for changing system colors would produce a global
effect - I don't think it works on application level.

Val.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top