Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
60
Put image in ribbon area
posted

Hi, is it possible to put n image in the ribbon on the area where the tab groups appear?

I need to show the logo for my applicacion on the red rectangle, the only way I got it to show is as ImageBackground, but I can't align the image to the right, only center, tile or stretch.

Thanks in advanced.

Parents
No Data
Reply
  • 29045
    Suggested Answer
    Offline posted

    Hello Israel,

    I put together a sample that achieves what you are looking for by using a Creation Filter. With this logic you can provide a new image within an ImageUIElement and add it as a child of the Ribbon area. 


    public void AfterCreateChildElements(UIElement parent)
    {

    // Check for the RibbonPagerArea            
    if (parent is RibbonTabPageUIElement)    
             {
                  Image newImage = RibbonGroupAreaSample.Properties.Resources.Image;   
                  ImageUIElement aImageUIElement = (ImageUIElement)parent.GetDescendant(typeof(ImageUIElement));    

                 if (aImageUIElement == null)             
                    {                    
                     //Create a New ImageUIElement                                    
                        aImageUIElement = new ImageUIElement(parent, newImage);           
                    }            

                      parent.ChildElements.Add(aImageUIElement);

                    //Size and position the new image to the far right of the group area with padding as necessary.      

                    aImageUIElement.Rect = new Rectangle(parent.Rect.Width - newImage.Width + 10, parent.Rect.Y, parent.Rect.Width,

    For more details please refer to my sample attached.

    RibbonGroupAreaSample.zip
Children
No Data