Button on ribbon disabled color

4 posts, 1 answers
  1. Kuba
    Kuba avatar
    13 posts
    Member since:
    Aug 2013

    Posted 16 Dec 2013 Link to this post

    Hi,

    how can I adjust color of disabled button? By default image is changed to grayscale but in my program I need it to be darker.
    How can I adjust it in Visual Style Builder?

    Cheers,
    Kuba. 
  2. Dess
    Admin
    Dess avatar
    1609 posts

    Posted 19 Dec 2013 Link to this post

    Hello Kuba,

    Thank you for contacting us again.

    If your requirement is to modify disabled state for the ButtonInRibbonGroup, it is necessary to disable UseDefaultDisabledPaint for the RibbonBarButtonElement and specify the desired fill for the ButtonInRibbonFill in the Visual Style Builder. Please find attached a sample picture, illustrating more precisely my point. Then the custom theme should be applied for the desired button or to the entire application, depending on your specific case.

    You can read more details about using the VisualStyleBuilder here:
    1.     Loading predefined themes
    2.     Working with Repository Items
    3.     Saving and Loading Theme Files
    4.     Loading Themes from an External File
    5.     Loading Themes from a Resource
    6.     Applying Theme to a Control
    7.     
    http://tv.telerik.com/watch/winforms/visualstylebuilder/whats-new-visual-style-builder-q1-2010

    Please do not hesitate to contact us if you have any additional questions.

    Regards,
    Desislava
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WINFORMS.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Kuba
    Kuba avatar
    13 posts
    Member since:
    Aug 2013

    Posted 19 Dec 2013 Link to this post

    Hi,
    thanks for your reply, but it is not exactly my point.

    The idea is, that button while disabled has its image changed to grayscale. In attachment you can see three buttons on ribbon. The one on the left is enabled, rest is disabled. By default their images are white, but when they are changed to gray, what is visible in this image. Unfortunately my program is all in different shades of gray, and disabled buttons images are too light. It's not about button fill, but about image fill.

    Cheers,
    Kuba.
  5. Answer
    Dess
    Admin
    Dess avatar
    1609 posts

    Posted 23 Dec 2013 Link to this post

    Hello Kuba,

    Thank you for getting back to me.

    Your clarification helped me to understand better the exact requirement. However, when the Enabled property has value false, the RadButtonElement is displayed in grayscaling mode. The button image is rendered in grayscaling mode as well. But the white part in the image sightly defers from the Enabled=true state. The possible solution that I can recommend is to use different images for both of the states. You can apply different algorithms on the image rendering in order to obtain the desired distinguishable image. Here is a useful resource how to transform a colored image into a grayscaling one. You may follow similar approach to change the image rendering.

    Please do not hesitate to contact us if you have any additional questions.

    Regards,
    Desislava
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WINFORMS.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
Back to Top