tags:

views:

83

answers:

2

Hi,

I have a couple of custom user controls, which may display text, or some other element, and which are custom rendered (by overriding OnPaint). Now, normal .NET controls (such as Labels, etc), grey out, and 'look' properly disabled when the Enabled property for them is set to false. My custom components do not, and still appear very much active.

I'm not 100% sure what properties or colors are used to indicate an equivalent 'disabled' state, does anyone know?

Cheers

+2  A: 

Use ControlPaint.DrawTextDisabled & ControlPaint.DrawImageDisabled methods.

logicnp
Just what I was looking for, cheers.
Kazar
A: 

Disabled controls are usually greyed out, and the user cannot interact with them.

For example, the background of a disabled TextBox will be grey, and the user is unable to set focus or edit or select text in the TextBox. A disabled DropDownList will have a grey background, and the user will not be able to pop open the list by clicking on it.

I'd recommend sticking with this convention, but it may or may not fit in with the design of your controls. Perhaps if you post some screenshots, more relevant answers could be supplied.

Winston Smith