none
QuickStylesGallery and buttons RRS feed

  • Question

  • I want use basic QuickStylesGallery in my ribbon.

    I want the gallery, but I am not want the buttons (clear formating).

    What am I need to do to not visible the buttons? 

    Sunday, May 20, 2012 7:04 AM

Answers

  • <<That is what I want to do. How am I do it?>>

    Some things cannot be done - by design.

    <<Can I set visible = false to this buttons?>>

    No, you cannot make built-in buttons invisible. Doing so would go against the Design concept for the Ribbon, which states that the user should be presented with as static a choice as possible (things not disappearing and appearing). So you can only disable.

    <<How am I delete the 'children' from ther parent?>>

    You cannot change built-in buttons in this manner. You can only disable or re-purpose.

    <<Can I set other onAction from there buttons?>>

    You should be able to use a <commands> section in Ribbon XML to re-purpose most (not all) built-in commands. Look up the ControlID idMso from the list of control ids, create a <command> element and assign the value to the idMso attribute. Then point to the procedure you want to use as a callback (that need not do anything, or can do what you wish, within reason).

    Here's a bit of sample Ribbon XML (a commands section) that repurposes the built-in Copy command:

    <commands>
         <command idMso="Copy" onAction="myCopy" />
    </commands>


    Cindy Meister, VSTO/Word MVP

    Wednesday, May 23, 2012 3:18 PM
    Moderator

All replies

  • Hi hila

    It's not possible to remove or otherwise change the content of a built-in control. The best you could do would be to disable the built-in commands connected to the buttons (ClearFormatting).


    Cindy Meister, VSTO/Word MVP

    Monday, May 21, 2012 9:03 AM
    Moderator
  • That is what I want to do. How am I do it?

    Can I set visible = false to this buttons?

    How am I delete the 'children' from ther parent?


    Can I set other onAction from there buttons?
    • Edited by hila_d Tuesday, May 22, 2012 12:11 PM
    Monday, May 21, 2012 12:17 PM
  • <<That is what I want to do. How am I do it?>>

    Some things cannot be done - by design.

    <<Can I set visible = false to this buttons?>>

    No, you cannot make built-in buttons invisible. Doing so would go against the Design concept for the Ribbon, which states that the user should be presented with as static a choice as possible (things not disappearing and appearing). So you can only disable.

    <<How am I delete the 'children' from ther parent?>>

    You cannot change built-in buttons in this manner. You can only disable or re-purpose.

    <<Can I set other onAction from there buttons?>>

    You should be able to use a <commands> section in Ribbon XML to re-purpose most (not all) built-in commands. Look up the ControlID idMso from the list of control ids, create a <command> element and assign the value to the idMso attribute. Then point to the procedure you want to use as a callback (that need not do anything, or can do what you wish, within reason).

    Here's a bit of sample Ribbon XML (a commands section) that repurposes the built-in Copy command:

    <commands>
         <command idMso="Copy" onAction="myCopy" />
    </commands>


    Cindy Meister, VSTO/Word MVP

    Wednesday, May 23, 2012 3:18 PM
    Moderator