none
Button properties are ignored if user creates new group and puts buttons in it RRS feed

  • Question

  • I am creating a VSTO Add-In for Word 2010 with Visual Studio 2010.  I have:

      • some buttons with a 16x16 image and I don’t want the image to grow so I set the Locked property to True
      • other buttons that I want to show with only a label so I set the ShowImage property to False
      • buttons that I want to show with only an image so I set the ShowLabel property to False

    These properties work like a charm when the buttons are in the RibbonGroup that I created in the Ribbon Designer.

    When the user customizes the ribbon and creates a new group and puts my buttons on it:

    1. buttons with an image are resized to 32x32
    2. buttons that should have only a label now have an image (a green ball)
    3. buttons that should have only an image now have a label

    Do I have any control over the buttons when they are “copied” like this?  Or do I need to provide both a label and a (32x32) image for every button?

    Thanks.

    Saturday, September 8, 2012 12:23 AM

Answers

  • Hi Jack

    As this is a VSTO question I'm going to move the discussion to the VSTO forum...

    You have no control over the properties when a user "copies" them to the QAT or a custom group, although you may be able to suppress the Label (third point) by simply not providing any (leave the Label property in the Properties window for the Ribbon Designer empty).

    Locked is not a property of a Ribbon.Button in the underlying Ribbon XML (the thing the Designer abstracts for you so that you don't have to type a lot of XML). It also doesn't appear to prevent you from moving the button on the Ribbon Designer surface, which is what the property would do in a Windows Form. So I'm really not sure what it's for, but it won't "lock" the control's properties.

    And there's no way to stop Word assigning the green button (for an unknown image) to a control the user creates for himself.


    Cindy Meister, VSTO/Word MVP, my blog

    • Marked as answer by Jack Panel Saturday, September 8, 2012 11:30 AM
    Saturday, September 8, 2012 8:31 AM
    Moderator

All replies

  • Hi Jack

    As this is a VSTO question I'm going to move the discussion to the VSTO forum...

    You have no control over the properties when a user "copies" them to the QAT or a custom group, although you may be able to suppress the Label (third point) by simply not providing any (leave the Label property in the Properties window for the Ribbon Designer empty).

    Locked is not a property of a Ribbon.Button in the underlying Ribbon XML (the thing the Designer abstracts for you so that you don't have to type a lot of XML). It also doesn't appear to prevent you from moving the button on the Ribbon Designer surface, which is what the property would do in a Windows Form. So I'm really not sure what it's for, but it won't "lock" the control's properties.

    And there's no way to stop Word assigning the green button (for an unknown image) to a control the user creates for himself.


    Cindy Meister, VSTO/Word MVP, my blog

    • Marked as answer by Jack Panel Saturday, September 8, 2012 11:30 AM
    Saturday, September 8, 2012 8:31 AM
    Moderator
  • Thanks very much Cindy

    J.

    Saturday, September 8, 2012 11:30 AM