This is a migrated thread and some comments may be shown as answers.

RibbonBar:RadButtonElement

2 Answers 79 Views
RibbonBar
This is a migrated thread and some comments may be shown as answers.
Baboi
Top achievements
Rank 1
Baboi asked on 08 Oct 2015, 09:58 AM

 I add a new RadButtonElement in RadRibbonBarGroup and Set the image of RadButtonElement . When the cursor over the button, the button's color(?) changes.

Like the attach images.

But I wrote following code, it do not have the same change when  the cursor over the button.

So I want ask which property can achieve that。

.

 

 

2 Answers, 1 is accepted

Sort by
0
Baboi
Top achievements
Rank 1
answered on 08 Oct 2015, 10:11 AM

Sorry, The code:

 RadButtonElement btnChangePassword = new RadButtonElement();
                btnChangePassword.ButtonFillElement.BackColor = Color.Transparent;
                btnChangePassword.ButtonFillElement.GradientStyle = Telerik.WinControls.GradientStyles.Solid;
                btnChangePassword.Class = "RibbonBarButtonElement";
                btnChangePassword.Click += btnChangePassword_Click;
                btnChangePassword.Image = Properties.Resources.Config_Default;
                btnChangePassword.Margin = new Padding(0, 20, -20, 0);
                btnChangePassword.TextImageRelation = TextImageRelation.ImageAboveText;
                btnChangePassword.BorderElement.Visibility = ElementVisibility.Hidden;
                this.radRibbonBarMain.RibbonBarElement.ButtonsContainer.Children.Insert(0, btnChangePassword);​

0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 09 Oct 2015, 02:33 PM
Hello Baboi,

Thank you for writing.

The local value, applied to the BackColor property, overrides the applied styles coming from the theme. That is why the applied color for the hover state is lost. Since Q3 2015 we have introduced a new API for changing the style for a specific element state without losing the applied style for the rest of the states. Please refer to the Override Theme Settings at Run Time help article which demonstrates how to change the BackColor without losing the hover style.

I hope this information helps. Should you have further questions I would be glad to help.
 
Regards,
Dess
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
Tags
RibbonBar
Asked by
Baboi
Top achievements
Rank 1
Answers by
Baboi
Top achievements
Rank 1
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or