Forms > Forms Assembly Interfaces > IRibbonPaletteButton > IRibbonPaletteButton.ButtonMode
ButtonMode: Boolean;
ButtonMode: Boolean;
The ButtonMode property determines a mode of button work.
If the property is set to True, the button works in common mode, that is, the control, that is Button, is displayed on the panel, the triangle is displayed to the right of the button. Clicking the button displays the combobox. The menu contains a base collection of graphic buttons and additional controls related to this button:
If the property is set to False, the button is displayed on the ribbon. Main set of graphic buttons is grouped and displayed on the panel. This button also includes the More button, clicking which displays a combobox that includes basic graphic buttons and additional controls:
Executing the example requires a form, a button named Button1 on the form, the Ribbon component named Ribbon1, and the ImageList component named PaletteImg. A tab and a panel are created on the ribbon of the Ribbon1 component. A large image with the width multiple of 20 is loaded to PaletteImg.
Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
RPanel: IRibbonPanel;
RPalette: IRibbonPaletteButton;
ChildElements: IRibbonElementsCollection;
ChildButton: IRibbonButton;
Begin
RPanel := Ribbon1.ActiveCategory.Panels.Item(0);
RPalette := New RibbonPaletteButton.Create;
RPanel.Elements.Add(RPalette);
RPalette.ButtonMode := True;
RPalette.ColumnCount := 4;
RPalette.Images := PaletteImg;
RPalette.IconWidth := 20;
RPalette.ResizeList := RibbonPaletteResize.Both;
RPalette.Text := "Icons";
ChildElements := RPalette.SubItems;
ChildButton := New RibbonButton.Create;
ChildElements.Add(ChildButton);
ChildButton.Text := "Add";
ChildButton.ImageIndex := 0;
End Sub Button1OnClick;
On clicking the button a button that opens a combobox is created on the ribbon panel. The base collection of graphic buttons is formed from separate images obtained by dividing the PaletteImg component into separate images 20 pixels wide. An additional button is added after the base collection of graphic buttons.
See also: