Changing a RibbonButton font color?

Posted by: vsaldana on 29 September 2020, 7:10 am EST

  • Posted 29 September 2020, 7:10 am EST

    Hello,

    The classic Ribbon allowed to change the font color of a RibbonButton (using the attributes ForeColorInner/ForeColorOuter).

    This feature is missing on the new Ribbon and we understand that it’s because now the appearence of those controls depend on the Theme that is applied.

    The problem is that themes apply to all the RibbonButtons in the Ribbon at once.

    Is there any way to change the font color of a single RibbonButton?

  • Posted 4 October 2020, 3:48 am EST

    Hi,

    There is no direct way to change the forecolor of a single button. However, you can manually draw the text. To do the same, you can set the OwnerDraw property of RibbonButton to true and handle the DrawItem event. Please refer to the attached sample for implementing the same.

    Thanks,

    Mohit

    RibbonButtonForeColor.zip

  • Posted 7 October 2020, 10:51 am EST

    Thank you for your reply.

    Sadly I can’t use this method because we use icons in the whole Ribbon.

    I could try to draw the icon of the button too, but It’s not easy to do, as I should find out the image size and position and text position that can change depending on the size of the main window.

    I’ll try to fiddle with it to see what I can do, but I see that it’s even more complicated than what I imagined.

  • Posted 8 October 2020, 10:52 am EST

    Hello,

    I have escalated this issue to the development team(466873) as an enhancement request and will update you once I get any information.

    Thanks,

    Mohit

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels