Elements: IRibbonElementsCollection;
Elements: Prognoz.Platform.Interop.Forms.IRibbonElementsCollection;
The Elements property returns collection of control elements united in the group.
Executing this example requires a form, a button named Button1 positioned on this 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;
On clicking the button a group of controls is created on the ribbon panel. Text editor and a button are included into the group.
See also: