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.

  • 29105
    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
  • 29105
    Offline posted

    Hello Israel, 

    After discussing this with my team we believe it's possible to use a draw filter/creation filter add a picture or logo the specified group area. Because this functionality is not built in to our control I would need to investigate this further to see how this can be implemented.

    In the meantime, let me know if you have any additional questions.

  • 29105
    Verified Answer
    Offline posted

    Hello Israel Perez,

    I investigated your request however I came to the conclusion that it's not possible. You can add a background image to each individual component of the Ribbon but you cannot resize them or reposition them. You can submit a feature request on our website at ideas.infragistics.com