0

I want to replace a TDBNavigator with a button.

I did :

procedure TForm1.Button1Click(Sender: TObject);
begin
  DBNavigator2.BtnClick(nbNext);
end;

but I got an error :

[dcc32 Error] Unit1.pas(284): E2010 Incompatible types: 'TNavigateBtn' and 'TNavigateButton'

Please, could anyone tell me how to fix this problem?

Remy Lebeau
  • 555,201
  • 31
  • 458
  • 770

1 Answers1

1

Use the full type name TNavigateBtn.nbNext, for example:

DBNavigator2.BtnClick(TNavigateBtn.nbNext);

That happens most probably because you have Data.Bind.Controls unit in your uses clause. This unit declares the same named nbNext member as a part of the TNavigateButton enumeration.

Victoria
  • 7,822
  • 2
  • 21
  • 44
  • thank you very much it is possible to make this button disable when he come to the end of recod ? like the button of dbnavigator? – Mohammed Bouhlal Sep 08 '17 at 00:52
  • You're welcome! What you mean by end of record? If you mean the end of a dataset (last record), then it should already happen.. – Victoria Sep 08 '17 at 00:55
  • 1
    @MohammedBouhlal that is a new question and needs to be posted separately. This question has been answered as asked. – Remy Lebeau Sep 08 '17 at 00:57
  • @Victoria DBNavigator disables its own buttons automatically, but a user's own button would have to be disabled manually. – Remy Lebeau Sep 08 '17 at 00:58