Delphi - Como colocar Captions no DBNavigator


Primeiramente crie um novo Tipo da classe TDBNavigator:

type
  TDBNewNavigator = class(TDBNavigator);

Crie um Novo Projeto, coloque um DBNavigator e no Evento OnCreate deste Form coloque o seguinte código:

Declare a seguinte Unit.

implementation

{$R *.dfm}

uses buttons;

procedure TForm1.FormCreate(Sender: TObject);
var  
  B: TNavigateBtn;
begin
  for B := Low(TNavigateBtn) to High(TNavigateBtn) do
    with TDBNewNavigator(DBNavigator1).Buttons[B] do 
    begin
      Case Index of
        nbFirst : Caption := 'Inicio';
        nbPrior : Caption := 'Anterior';
        nbNext : Caption := 'Próximo';
        nbLast : Caption := 'Último';
        nbInsert : Caption := 'Novo';
        nbDelete : Caption := 'Apagar';
        nbEdit : Caption := 'Alterar';
        nbPost : Caption := 'Gravar';
        nbCancel : Caption := 'Cancelar';
        nbRefresh: Caption := 'Atualizar';
      End;
      Layout := blGlyphTop;
      Hint := Caption;
      ShowHint := True;
    end;
  end;
end; 

Comentários

Postagens mais visitadas deste blog

Delphi - ReportBuilder – Conhecendo os Recursos deste Gerador de Relatórios

Delphi - Stringgrid com Alinhamento à Direita, à Esquerda e Centralizado

Delphi - Instalando a versão Trial do Delphi 2007 for Win 32