Versions Compared

Key

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

...

In the following example, we are adding a Find button to four different places: a group whose key is "EDITING", the Quick Access toolbar, the Tab Bar area, and to a Split Button's sub-menu dropdown. Note how we define the button's command the first time, then simply reference the command in all the other buttons. Thus, no matter which button the user clicks, the same event fires. All four buttons need to have a unique Key, even though they can share the same command.

 

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