RadRibbonBar Startmenu

2 posts, 0 answers
  1. webclaws
    webclaws avatar
    4 posts
    Member since:
    Apr 2018

    Posted 15 Apr 2018 Link to this post

    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

  2. Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    3469 posts

    Posted 16 Apr 2018 Link to this post

    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.
Back to Top