Overriding the "disabled" look for e.g textboxes

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

Is there a way to override the shadowed (grey) backcolor of a textbox when the
textbox is disabled for input (textbox.enabled = false) ? In some cases I
want to
have a custom backcolor when the textbox is disabled.

The same question applies for a listview. When the listview is disabled, the
backcolor of the listview turns grey (shadowed) for the area which is not
filled
with any items (the "view" is set to "details", so each item in the listview
represents
one row in the listview). For a listbox or datagrid, the behaviour is
different, since
the backcolor is kept when disabled.
 
You can't directly do that. But you can add your own disabled/readonly
functionality for textboxes.
You have to add a property bool IsReadOnly or similar, and if the readonly
flag is set, your textbox must intercept every pressed key so that the
textbox appears readonly.
 
Back
Top