Search code examples
vstooffice-interopribbon-controlribbonx

How to display two controls aligned horizontally in a custom Ribbon XML


In a group of a custom tab of a Ribon XML of a custom VSTO WORD AddIn, I need to display an editBox aligned horizontally inline with a checkBox. How can I achieve that? Following displays both the controls aligned vertically one after the other:

<tab idMso="TabAddIns">  
    <group id="ContentGroup" label="Content">  
        <editBox id="editBoxID" label="Insert Text"  
             screentip="Text" onAction="getText"/>  
        <checkBox id="checkBoxID" label="Enable" />  
    </group>  
</tab>

Solution

  • Use a box, with a horizontal boxStyle.

    <group id="groupid" label="Content">
      <box id="ContentGroup" boxStyle="horizontal">
        <editBox id="editBoxID" label="Insert Text" />
        <checkBox id="checkBoxID" label="Enable" />
      </box>
    </group>
    

    Result of this ribbon XML