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:
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.
Click the Ribbon tab group’s title to select a toolbar associated with the group.
- In the Object Inspector, click the ellipsis button next to the bar’s CaptionButtons property to open the collection editor.
- Using the collection editor, create a dialog launcher button, and specify a KeyTip and ScreenTip for it (if necessary).
- 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