这种方法完全符合你的要求:)
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
ExtCtrls, DBCtrls, Buttons, StdCtrls, Db, DBTables;
type
TForm1 = class(TForm)
DBNavigator1: TDBNavigator;
Button1: TButton;
DataSource1: TDataSource;
Table1: TTable;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
type
TDBNavigatorEx = class(TDBNavigator)
public
procedure SetButtons;
end;
{ TDBNavigatorEx }
procedure TDBNavigatorEx.SetButtons;
begin
Buttons[nbFirst].Caption := 'Test&F';
Buttons[nbFirst].Layout := blGlyphBottom;
Buttons[nbPrior].Caption := 'Test&P';
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
TDBNavigatorEx(DBNavigator1).SetButtons;
end;
end.