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

RadRibbonBar Startmenu

1 Answer 142 Views
RibbonBar
This is a migrated thread and some comments may be shown as answers.
webclaws
Top achievements
Rank 1
webclaws asked on 15 Apr 2018, 12:12 PM

i'm using the theme controldefaut . In ribbonbar and office 2007 app menu there is a blue rounded button in start menu. On mouse over it change color to orange.

Is it color or image change? 

I like to make it red when i click a button.

Thanks for help

1 Answer, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 16 Apr 2018, 01:03 PM
Hello,    
 
By design, the application menu in RadRibbonBar has a RadImageShape applied for the different elements states to the RibbonBarElement.ApplicationButtonElement.ActionButton.ButtonFillElement.BackgroundShape property. Thus, the image shape is blue for the normal state and orange for the MouseOver state. You can open the theme in Visual Style Builder and customize the theme according to your requirement with the desired colored shapes for the different states. 



Alternatively, you can handle the MouseEnter and MouseLeave events of the RibbonBarElement.ApplicationButtonElement.ActionButton and set its BackgroundShape property using a custom image that you have. The result is illustrated in the attached gif file. 

RadImageShape defaultShape = null;
 
public Form1()
{
    InitializeComponent();
 
    defaultShape = new RadImageShape();
    defaultShape.Image = Properties.Resources._03;
    this.radRibbonBar1.RibbonBarElement.ApplicationButtonElement.ActionButton.ButtonFillElement.BackgroundShape = defaultShape;
    this.radRibbonBar1.RibbonBarElement.ApplicationButtonElement.ActionButton.MouseEnter += ButtonFillElement_MouseEnter;
    this.radRibbonBar1.RibbonBarElement.ApplicationButtonElement.ActionButton.MouseLeave += ActionButton_MouseLeave;
}
 
private void ActionButton_MouseLeave(object sender, EventArgs e)
{
    if (defaultShape != null)
    {
        this.radRibbonBar1.RibbonBarElement.ApplicationButtonElement.ActionButton.ButtonFillElement.BackgroundShape = defaultShape;
    }
}
 
private void ButtonFillElement_MouseEnter(object sender, EventArgs e)
{
    RadImageShape myShape = new RadImageShape();
    myShape.Image = Properties.Resources._04;
    this.radRibbonBar1.RibbonBarElement.ApplicationButtonElement.ActionButton.ButtonFillElement.BackgroundShape = myShape;
}

I hope this information helps. If you have any additional questions, please let me know. 

 Regards,
Dess
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
RibbonBar
Asked by
webclaws
Top achievements
Rank 1
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or