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.
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,
// 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.