By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,190 Members | 1,653 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,190 IT Pros & Developers. It's quick & easy.

Overriding the "disabled" look for e.g textboxes

P: n/a
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.
--
MP
Nov 16 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
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.

--
cody

Freeware Tools, Games and Humour
http://www.deutronium.de.vu || http://www.deutronium.tk
"Morten Plathe" <Mo**********@discussions.microsoft.com> schrieb im
Newsbeitrag news:72**********************************@microsof t.com...
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.
--
MP

Nov 16 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.