To determine which button is pressed on the TDBNavigator?  

Send By: Q3 Team
Web : http://www.q3.nu
Email: dlib@q3.nu
Date: 27/06/99

Tip accessed 499 times

 


We can determine it using the event OnClick of the TDBNavigator

An example:


    procedure TForm1.DBNavigator1Click(Sender: TObject; Button:
    TNavigateBtn);
    var
      BtnName: string;
    begin
      case Button of
        nbFirst  : BtnName := 'nbFirst';
        nbPrior  : BtnName := 'nbPrior';
        nbNext   : BtnName := 'nbNext';
        nbLast   : BtnName := 'nbLast';
        nbInsert : BtnName := 'nbInsert';
        nbDelete : BtnName := 'nbDelete';
        nbEdit   : BtnName := 'nbEdit';
        nbPost   : BtnName := 'nbPost';
        nbCancel : BtnName := 'nbCancel';
        nbRefresh: BtnName := 'nbRefresh';

      end;
      MessageDlg(BtnName + ' button clicked.', mtInformation, [mbOK], 0);
    end;