You're right.
It seems that there is not an easy solution, at least in the first 20/30
results on google and I'm not even talking about msdn...
Maybe he could just do the background trick I suggested setting the ReadOnly
property to false instead of disabling the control.
And if he also wants the control not to be selectable he could just handle
the Enter() event giving the focus to some other control.
What would you suggest?
Regards,
Fabrizio
"Eric Moreau" <(E-Mail Removed)> wrote in message
news:OYu%(E-Mail Removed)...
> Your BackColor implementation is working correctly but the ForeColor
> isn't. It has always been the problem of disabled controls.
>
> --
>
>
> HTH
>
> Éric Moreau, MCSD, Visual Developer - Visual Basic MVP
> Conseiller Principal / Senior Consultant
> S2i web inc. (www.s2i.com)
> http://emoreau.s2i.com/
>
> "Fabrizio Romano" <(E-Mail Removed)> wrote in message
> news:45a190a8$0$19101$(E-Mail Removed)...
>> Well, I suppose he could just do the same for the ForeColor as what I did
>> for the BackColor.
>> I really had 2 minutes so I just showed the trick with one color. 
>>
>> Regards,
>> Fabrizio
>>
>> "Eric Moreau" <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed)...
>>> What about the ForeColor?
>>>
>>> --
>>>
>>>
>>> HTH
>>>
>>> Éric Moreau, MCSD, Visual Developer - Visual Basic MVP
>>> Conseiller Principal / Senior Consultant
>>> S2i web inc. (www.s2i.com)
>>> http://emoreau.s2i.com/
>>>
>>> "Fabrizio Romano" <(E-Mail Removed)> wrote in message
>>> news:459e955e$0$19100$(E-Mail Removed)...
>>>> My first guess would be doing something like that:
>>>>
>>>> ////////////////////////////////////////////////////////////////////////////////////////////////////////////////
>>>> public class CustomDisabledTextBox : System.Windows.Forms.TextBox{
>>>>
>>>> Color disabledBackColor, originalBackColor;
>>>>
>>>> public CustomDisabledTextBox() {
>>>> disabledBackColor = Color.LightBlue; // or whatever you like
>>>> }
>>>>
>>>> protected override void OnEnabledChanged(EventArgs e) {
>>>> if (!this.Enabled) {
>>>> this.originalBackColor = this.BackColor;
>>>> this.BackColor = disabledBackColor;
>>>> } else {
>>>> this.BackColor = originalBackColor;
>>>> }
>>>> base.OnEnabledChanged(e);
>>>> }
>>>>
>>>> [Browsable(true)]
>>>> public Color DisabledBackColor {
>>>> get {
>>>> return this.disabledBackColor;
>>>> }
>>>> set {
>>>> this.disabledBackColor = value;
>>>> }
>>>> }
>>>>
>>>> }
>>>> ////////////////////////////////////////////////////////////////////////////////////////////////////////////////
>>>>
>>>> And use this textbox.
>>>> When the Enable state changes in the overridden method you place the
>>>> desired color. If the control is disabled you place yours, otherwise
>>>> the original one.
>>>> Also, adding the property accessor with the [Browsable(true)] attribute
>>>> let's you define the disabled back color at design time.
>>>>
>>>> Done in 2 minutes so don't take this at 100% best solution ok?
>>>> Regards
>>>> Fabrizio
>>>>
>>>> <(E-Mail Removed)> wrote in message
>>>> news:(E-Mail Removed)...
>>>>> I'm using krypton toolkit which has allowed me to make a cool looking
>>>>> form. However, when I set my textbox to disabled it is 'greyed' out.
>>>>> The grey colour isn't in keeping with the office 2007 style look of my
>>>>> form. How can i change the colour that control assumed when it's
>>>>> disabled?
>>>>>
>>>>> Thanks!
>>>>>
>>>>> Gary-
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>