Radbutton back color

Thanh

I'm working with RadButton, (like attached image). When click on WorkWeek button, the background is changed as attached image, but after click it change to color as the color when mouse on hover the button. But I want when after click it still keep color as the color when I click, and then I click on another button (Week button for example), that backcolor is set for another button (not set for WorkWeek button any more). How can I do it?

Hristo

The BackColor property is usually set through a theme defining various colors for the different states. TPF exposes an API for overriding the theme settings at run-time preserving the styles defined for all the element states: Override Theme Settings at Run Time.

I created a simple example for toggling a color between two buttons inside RadRibbonBar. Please check my code snippet below:

Should you have further questions please do not hesitate to write back.

Regards,
Hristo Merdjanov
Telerik

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items

Thanh

There is a small issue that I want to change to color as the color when button is clicked on. So that when user change theme, the color is changed according that theme. How can I get the color as the color when I click on button?

Or telerik have anyway that I can set group of button, then it can mark the button have just clicked?

I hope this helps. Should you have further questions please do not hesitate to write back.

Regards,
Hristo Merdjanov
Telerik

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items

Hristo

As I said earlier the styles are usually defined through repository items and the different themes for some settings use unique repositories. This way they define their own style.

Our VSB tool provides information about the theme settings. You can read the name of a repository and at run-time find it and use its style according to your scenario. Considering the Office2013Theme, you can get the back color this way:

I hope this helps. Should you have further questions please do not hesitate to write back.

Regards,
Hristo Merdjanov
Telerik

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items

I hope this helps. Should you have further questions please do not hesitate to write back.

Regards,
Hristo Merdjanov
Telerik by Progress

Check out the Windows Forms project converter, which aids the conversion process from standard Windows Forms applications written in C# or VB to Telerik UI for WinForms. For more information check out this blog post and share your thoughts.

Progress, Telerik, and certain product names used herein are trademarks or registered trademarks of Progress Software Corporation and/or one of its subsidiaries or affiliates in the U.S. and/or other countries. See Trademarks or appropriate markings.