Adds new tabs to the control.

Syntax

Error = Send_Message(Ctrl, "OLE.AddTabs", Xml)

Parameters

PropertyDescription
XmlThe XML snippet used to add tabs.

Returns

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

Remarks

The AddTabs method allows you to add new tabs to the ribbon at runtime. This is the only way to add new tabs. 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 <AddTabs> element. Each XML element is documented on the wiki, but you'll want to start with the <AddTabs> element and work your way down.

Example

In the following example, we are adding two new tabs. The first tab shows how you might support add-ons in your application, allowing you to modularize extra features. The second tab shows how you might implement a tab that the user can customize with their favorite actions.

Xml  = ''
Xml := '<AddTabs>'
Xml := '    <Tab Key="EMAIL_ADDON" Caption="Email" KeyboardTip="E">'
Xml := '        <Group Key="ACTIONS" Caption="Actions" OptionButton="false" Icon="Icons\email.png">'
Xml := '             <Button Key="BTN_EMAIL_REPORT">'
Xml := '                <Command Key="EMAIL_REPORT" Caption="Email Report" LargeIcon="Icons\mail_new.png" />'
Xml := '            </Button>'
Xml := '             <Button Key="BTN_CHECK_EMAIL">'
Xml := '                <Command Key="CHECK_EMAIL" Caption="Check Report Mail" LargeIcon="Icons\mail_open.png"/>'
Xml := '            </Button>'
Xml := '        </Group>'
Xml := '    </Tab>'
Xml := '    <Tab Key="USER_COMMANDS" Caption="Favorites">'
Xml := '        <Group Key="DATA_USER" Caption="Data Entry" Icon="Icons\database.png">'
Xml := '            <Button Key="BTN_ACCOUNTS" Key="ACCOUNTS" />'
Xml := '            <Button Key="BTN_INVENTORY" Key="INVENTORY" />'
Xml := '        </Group>'
Xml := '        <Group Key="REPORTS_USER" Caption="Reporting" Icon="Icons\reports.png">'
Xml := '            <Button Key="BTN_ACCOUNTS_REPORT" Key="REPORT_ACCOUNTS" />'
Xml := '            <Button Key="BTN_INVENTORY_REPORT" Key="REPORT_INVENTORY" />'
Xml := '        </Group>'
Xml := '    </Tab>'
Xml := '</AddTabs>'
   
Send_Message(@Window:".OLE_RIBBON", "OLE.AddTabs", Xml)

See Also

RemoveTabs<AddTabs>

  • No labels