DBNavigator and the visible buttons

kacor
kacor used Ask the Experts™
on
Hi Experts,
This is a Delphi6 project. There is a DataModul1 contaning all data connections. The Form1 has a DBNavigator1 connected to Table1 on DataModul1, a bitButton1, some data-aware controls, and uses DataModul1. DBNavigator1 is set to surf between data e.g. visible buttons are nbFirst, nbPrior, nbNext and nbLast.
 
On Form1 it possible1 to activate all buttons of the DBNavigator1 by clicking the bitButton:

   Form1.DBNavigator1.VisibleButtons :=
      [nbFirst,nbPrior,nbNext,nbLast, nbInsert, nbDelete, nbEdit,
       nbPost, nbCancel, nbRefresh];
 
it works. But if I try to set to one event of the Table1 (for example to the event AfterCancel as follows) the button set restriction:

procedure TDataModule1.Table1AfterCancel(DataSet: TDataSet);
begin
   // nem lehet szerkeszteni
   Form1.DBNavigator1.VisibleButtons := [nbFirst,nbPrior,nbNext,nbLast];
end;

I get a lot of error messages:

[Error] DataModule1.pas(105): Undeclared identifier: 'nbFirst'
[Error] DataModule1.pas(105): Undeclared identifier: 'nbNext'
[Error] DataModule1.pas(105): Incompatible types: 'TNavigateBtn' and 'Integer'
[Fatal Error] Project1.dpr(7): Could not compile used unit 'DataModule1.pas'

How can I solve this problem? Thank you for your help.

with best regards

Janos
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Software Developer
Commented:
Hello

  Just add DBCtrls to the uses clause
kacorretired

Author

Commented:
Hi mnasman,

at first I wish you a happy new year and good health!

Rigth, I have choosen a bad way. In the meantime I've got a better idea to use a Boolean variable to switch between the two states Edit or Search only, and in an IF statement I can decide which set to use.

Again thanks for your help

Janos

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial