Elements: IRibbonElementsCollection;
The Elements property returns the collection of controls placed on the quick access toolbar.
The controls that already exist on the ribbon can be added to this collection. Numeric hotkeys will be automatically set for elements on the quick access toolbar: 1, 2, 3, and so on.
NOTE. If numeric hotkeys are also set for categories, they are executed first.
Executing the example requires a form, a button named Button1 on it and the Ribbon component named Ribbon1. A tab and a panel are created on the ribbon of the Ribbon1 component. Some controls are created on the panel.
Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
QAT: IRibbonQuickAccessToolbar;
QATElements: IRibbonElementsCollection;
RElements: IBaseRibbonElements;
RElement: IBaseRibbonElement;
Begin
QAT := Ribbon1.QuickAccessToolbar;
QATElements := QAT.Elements;
RElements := Ribbon1.Elements;
For Each RElement In RElements Do
If RElement.Name.IndexOf("PaletteButton") <> -1 Then
QATElements.Add(RElement);
End If;
End For;
End Sub Button1OnClick;
Clicking the button sets up the quick access toolbar for the ribbon. All controls that contain the text PaletteButton in their names are added on the toolbar.
See also: