Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Adds new controls to existing groups and other control containers.

Syntax

Code Block
Error = Send_Message(Ctrl, "OLE.AddControls", Xml)

...

PropertyDescription
XmlThe XML snippet used to add controls.

Returns

An XML parsing error, or "" if the XML parsed successfully. (Added in 4.1.20)

Remarks

The AddControls method allows you to add new controls to the ribbon at runtime. This is the only way to add new controls. Do not call Init multiple times.

To use this method, pass a string containing XML. It does not matter where the XML was originally stored. All that matters is that the one parameter you pass contains XML with one <AddControls> element. Each XML element is documented on the wiki, but you'll want to start with the <AddControls> element and work your way down.

...

Code Block
Xml  = ''
Xml := '<AddControls>'
Xml := '  <Group Key="EDITING">'
Xml := '    <Button Key="BTN_FIND">'
Xml := '      <Command Key="FIND" Caption="Find" SmallIcon="Icons\find.png" />'
Xml := '    </Button>'
Xml := '  </Group>'
Xml := '  <QuickAccessControls>'
Xml := '    <Button Key="QA_BTN_FIND" Command="FIND" />'
Xml := '  </QuickAccessControls>'
Xml := '  <TabBarControls>'
Xml := '    <Button Key="TB_BTN_FIND" Command="FIND" />'
Xml := '  </TabBarControls>'
Xml := '  <SplitButton Key="MY_SPLIT_BUTTON">'
Xml := '    <Button Key="SPL_BTN_FIND" Command="FIND" />'
Xml := '  </SplitButton>'
Xml := '</AddControls>'

Send_Message(@Window:".OLE_RIBBON", "OLE.AddControls", Xml)

See Also

RemoveContolsRemoveControls<AddControls>