Elements: IRibbonElementsCollection;
Elements: Prognoz.Platform.Interop.Forms.IRibbonElementsCollection;
The Elements property returns the collection of controls combined into a group.
Executing the example requires a form, a button named Button1 on the form, the ImageList component named GrImages, and the Ribbon component named Ribbon1. A tab and a panel are created on the ribbon of the Ribbon1 component.
Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
RPanel: IRibbonPanel;
RGroup: IRibbonGroup;
GroupElements: IRibbonElementsCollection;
GrEdit: IRibbonEdit;
GrButton: IRibbonButton;
Begin
RPanel := Ribbon1.ActiveCategory.Panels.Item(0);
RGroup := New RibbonGroup.Create;
RPanel.Elements.Add(RGroup);
RGroup.Images := GrImages;
GroupElements := RGroup.Elements;
GrEdit := New RibbonEdit.Create;
GrButton := New RibbonButton.Create;
GroupElements.Add(GrEdit);
GroupElements.Add(GrButton);
GrEdit.ImageIndex := 0;
GrButton.Text := "Save";
End Sub Button1OnClick;
Clicking the button creates a group of controls on the ribbon panel. Text editor and a button are included into the group.
See also: