Hi Mikeq,
If possible, I would prefer to change the backcolor used by windows to paint
disabled controls instead of iterating all controls and setting their
backcolor.
My application has many forms, so I'm afraid that if I had to code
everywhere a control enabled state can change (to enabled or disabled) my
source code will turn very heavy and error prone.
Is it possible to change the value of SystemColors.GrayText ? I know in
VS2005 it is readonly but maybe you can help me with some code to achieve
this result.
Thanks
> Try this:
>
[quoted text clipped - 14 lines]
> >
> > Thank you
mikeq - 03 Apr 2006 19:15 GMT
Sorry Toze, I don't know how to do that. I would put the suggested code in
each form.Load() function. I underestand you have many forms, so I would also
define a global variable that represents the color that you want so that you
can change it in just one place.
Color myDisabledColor = Color.Whatever;
...
Form.Load()
{
foreach(Control c in this.Controls)
{
if(c.enabled == false)
c.BackColor = myDisabledColor;
}
}
-- Mikeq
> Hi Mikeq,
>
[quoted text clipped - 30 lines]
> > >
> > > Thank you
Stoitcho Goutsev (100) - 03 Apr 2006 21:14 GMT
Toze,
This is not possible. This is system wide setting and cannot be controlled
for one application only. As Mikeq said you can control this on per control.

Signature
Stoitcho Goutsev (100)
> Hi Mikeq,
>
[quoted text clipped - 34 lines]
>> >
>> > Thank you