Search code examples
delphidelphi-10.2-tokyo

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


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?


Solution

  • 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.