Skip to main content

How to Add a Dialog Launcher to the Ribbon Tab Group at Design Time

The following example demonstrates how to add a dialog launcher button to the Ribbon tab group, at design-time.

Follow the steps below:

  1. If necessary, create a new Ribbon tab group. To learn how to create a Ribbon tab group, refer to the How to Create a Ribbon Control at Design-Time help topic.

  2. Click the Ribbon tab group’s title to select a toolbar associated with the group.

  1. In the Object Inspector, click the ellipsis button next to the bar’s CaptionButtons property to open the collection editor.

  1. Using the collection editor, create a dialog launcher button, and specify a KeyTip and ScreenTip for it (if necessary).

  1. Handle the button’s OnClick event to respond to the button click. In the following example, the event handler initializes the Font dialog:
// ...
begin
  FontDialog.Font.Assign(Editor.SelAttributes);
  if FontDialog.Execute then
    Editor.SelAttributes.Assign(FontDialog.Font);
end;

The following image shows the code execution result after the button has been clicked:

See Also