How to override the default style for disabled control?

4 posts, 0 answers
  1. Edward
    Edward  avatar
    32 posts
    Member since:
    Jan 2008

    Posted 28 May 2008 Link to this post

    The default style for disabled control is grey.  Instead of displaying it grey I want to have it use the same color, except that user cannot interact with the control

    I look into the Style Builder, but couldn't find anything regarding this.
  2. Mike
    Admin
    Mike avatar
    640 posts

    Posted 30 May 2008 Link to this post

    Hi Edward,

    I hope you be happy that answer of your question is fairly simple.

    The default disabled "paint" of each RadControl can be controlled through its RootElement.UseDefaultDisabledPaint property. It defaults to true, so in your case you should just set it to false and all should work just fine.

    Only RadTextBox has a slightly different behavior - the text would become gray. This is because of the hosted standard TextBox control that we use. I hope it would not be a great issue for you. I'm attaching a sample project that demonstrates this.

    If you have any additional questions, please contact us.

    All the best,
    Mike
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Edward
    Edward  avatar
    32 posts
    Member since:
    Jan 2008

    Posted 30 May 2008 Link to this post

    The text in RadComboBox is also grey out, just like the RadTextBox.  So I guess this behavior is inherited from the standard ComboBox control?
  5. Angel
    Admin
    Angel avatar
    121 posts

    Posted 02 Jun 2008 Link to this post

    Hello Edward,

    The text area of the RadComboBox is actually a text box. Unfortunately, this hosted text box does not give us a way to set the ForeColor of the disabled text - it is always gray. The structure of the RadComboBox is given in the Element Structure help article (RadTextBoxItem hosts a text box).

    To explore further the content of RadComboBox, you can use RadControlSpy:
    Documentation
    KB Articles

    I hope this helps. Contact me again if you need further information.

    All the best,
    Angel
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
Back to Top