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
270
Button's image minimized even after RibbonGroup.SetMaximumSize ?
posted

//Create the RibbonTabItem
 RibbonTabItem homeItem = new RibbonTabItem();

//Create the RibbonGroup
RibbonGroup 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

  • 270
    posted

    Found it

    Big Smile

     It had to be this  RibbonGroup.SetMaximumSize(btnNew , RibbonToolSizingMode.ImageAndTextLarge);