Disabled Text Color

4 posts, 0 answers
  1. Adam
    Adam avatar
    89 posts
    Member since:
    Mar 2008

    Posted 30 Nov 2010 Link to this post

    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.
  2. Richard Slade
    Richard Slade avatar
    3000 posts
    Member since:
    May 2009

    Posted 30 Nov 2010 Link to this post

    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
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Adam
    Adam avatar
    89 posts
    Member since:
    Mar 2008

    Posted 30 Nov 2010 Link to this post

    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
  5. Nikolay
    Admin
    Nikolay avatar
    1803 posts

    Posted 03 Dec 2010 Link to this post

    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.
Back to Top