Skip to main content

TcxCustomNavigatorButtons.CreateButtons Method

Creates a collection of default buttons for a navigator control.

Declaration

procedure CreateButtons; virtual;

Remarks

This method creates default buttons within the Buttons collection and assigns their default indexes as specified in the TcxCustomNavigatorButtons class description. After default buttons are created, you can customize their settings: visibility, accessibility, hint, and image.

The CreateButtons method can be overridden in TcxCustomNavigatorButtons descendants in order to customize default buttons. For instance, it is possible to create a subset of default buttons with predefined property values. The following sample code creates a collection of disabled buttons.

procedure CreateButtons;
var
  I: Integer;
  FButtons: TcxCustomNavigatorButtons;
begin
  for I := 0 to NavigatorButtonCount - 1 do
  begin
    FButtons[I] := TcxNavigatorButton.Create(Self);
    FButtons[I].DefaultIndex := I;
    FButtons[I].Enabled := False;
  end;
end;
See Also