//Create the RibbonTabItem RibbonTabItem homeItem = new RibbonTabItem();//Create the RibbonGroupRibbonGroup messagesGroup = new RibbonGroup(); messagesGroup.Caption = "Messages"; messagesGroup.FlowDirection = System.Windows.FlowDirection.LeftToRight; //Set the Maximum size to ImageAndTextLarge RibbonGroup.SetMaximumSize(messagesGroup, RibbonToolSizingMode.ImageAndTextLarge); // Create a new button ButtonTool btnNew = new ButtonTool(); btnNew.LargeImage = ConvertPathToImageUri(@"\Images\New_Message_Large.png"); btnNew.Content = "test"; //add the button to the ribbongroup messagesGroup.Items.Add(btnNew); homeItem.RibbonGroups.Add(messagesGroup);
The btnNew is shown on the ribbon , as suspected in the tabitem , in the Ribbongroup.
My problem is that this button is showing its text and image mimimized.and i set the property to this ?
//Set the Maximum size to ImageAndTextLarge RibbonGroup.SetMaximumSize(messagesGroup, RibbonToolSizingMode.ImageAndTextLarge);
any ideas would be appreciated.
Thx
Found it
It had to be this RibbonGroup.SetMaximumSize(btnNew , RibbonToolSizingMode.ImageAndTextLarge);