This is a migrated thread and some comments may be shown as answers.

Disabled Text Color

3 Answers 300 Views
TextBox
This is a migrated thread and some comments may be shown as answers.
Adam
Top achievements
Rank 2
Adam asked on 30 Nov 2010, 03:29 PM
What would the easiest way to be to change the text color of an editor (or checkbox, or combobox) and nothing else.  I have seen the post http://www.telerik.com/community/forums/winforms/editors/texbox-with-different-disabled-style.aspx but when I change UseDefaultDisabledPaint to false, the border effect goes away.

3 Answers, 1 is accepted

Sort by
0
Richard Slade
Top achievements
Rank 2
answered on 30 Nov 2010, 05:02 PM
Hello Adam,

The most up-to-date response from Telerik that I found on disavbled controls and themes read as follows;

"Our theming mechanism allows for setting a specific style to an element when this element is in a disabled state. In regards to the case of Linus, the following steps should be completed:
1. Open your theme in the Visual Style Builder and select RadListControl.
2. Select RadListVisualItem in the tree of the RadListControl.
3. In the Elements window expand RadListVisualItem and remove the property filter.
4. Find the property UseDefaultDisablePaint and set it to false.

These steps will allow for setting the text, fill and border of a RadListVisualItem when it is disabled."

I honestly haven't used VSB that much, but from what I understand it is easy to use and it should be the same for most controls.
I hope that helps but let me know if you have further questions
Richard
0
Adam
Top achievements
Rank 2
answered on 30 Nov 2010, 05:07 PM
Thanks for the reply Richard.

I think what I am running into is that the root of all of the text items is a standard .NET TextBox control.  When I set RadTextBox.Enabled = false, it sets the .NET TextBox.Enabled to false as well.  When this is set, the font color cannot be changed.

Since I posted originally, I tried basically the same steps but for the RadTextBox.  Either I don't know what I am doing in the VSB or the limitation of the TextBox is to blame.

-Adam
0
Nikolay
Telerik team
answered on 03 Dec 2010, 04:41 PM
Hi Adam,

Thank you for the question.

Richard's answer is valid for the visual text elements that our Telerik Presentation Framework provides - LightVisualElement and TextPrimitive. Since these are our own elements, you can change their color depending on various user conditions.

However, this is not the case with RadTextBox. RadTextBox internally hosts the standard TextBox. This TextBox, however, does not allow for changing its ForeColor when it is disabled, hence you can't change the appearance of the text in RadTextBox when it is disabled.

If you have additional questions, feel free to contact us.

Greetings,
Nikolay
the Telerik team
Get started with RadControls for WinForms with numerous videos and detailed documentation.
Tags
TextBox
Asked by
Adam
Top achievements
Rank 2
Answers by
Richard Slade
Top achievements
Rank 2
Adam
Top achievements
Rank 2
Nikolay
Telerik team
Share this question
or