Changing control enabled color

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • AllenF

    #1

    Changing control enabled color

    When one sets the "Enabled" property of a control such as a text box or
    combo box to "false", the field will change color to a dark gray. I would
    like to change this color to something else, such as a light blue to make
    the contents easier to read.

    Is this Possible????

    Thanx, Allen


  • Nicholas Paldino [.NET/C# MVP]

    #2
    Re: Changing control enabled color

    Allen,

    Unfortunately, this is handled by the system, and can only be changed on
    a system level. Because of this, you would have to change the system
    defaults, which would probably affect more than you want.

    However, you could handle the Paint event on the TextBox itself (or if
    you subclass it, the OnPaint method). You could do all the painting
    yourself, and you would get the color you want for the background.
    Unfortunately, you still have to do all the painting yourself.

    Hope this helps.


    --
    - Nicholas Paldino [.NET/C# MVP]
    - nicholas.paldin o@exisconsultin g.com

    "AllenF" <Feris_Allen@ms n.com> wrote in message
    news:%23ZhkAKWc DHA.2308@TK2MSF TNGP12.phx.gbl. ..[color=blue]
    > When one sets the "Enabled" property of a control such as a text box or
    > combo box to "false", the field will change color to a dark gray. I would
    > like to change this color to something else, such as a light blue to make
    > the contents easier to read.
    >
    > Is this Possible????
    >
    > Thanx, Allen
    >
    >[/color]


    Comment

    Working...