可以的,楼上的方法也行,不过,直接调用DBNavigator的方法也可:DBNavigator1.BtnClick(按钮);其中,按钮可为:按钮 按钮值 所执行操作First nbFirst Go to the first record Prior nbPrior Go to the previous record Next nbNext Go to the next record Last nbLast Go to the last record Insert nbInsert Insert a blank record Delete nbDelete Delete the current record Edit nbEdit Permit users to edit the current record Post nbPost Post the current record Cancel nbCancel Cancel the current edit Refresh nbRefresh Refresh the data in the dataset 一个好方法是把DBNavigator的Visabled属性设置为False,自己在按钮的事件中调用它的方法。
分别写上对应的代码就可以了
dataset.first;//数据集指向第一条
dataset.prior;//数据集指向当前的前一条
dataset.next;//数据集指向当前的下一条
dataset.last;//数据集指向最后一条
Prior nbPrior Go to the previous record
Next nbNext Go to the next record
Last nbLast Go to the last record
Insert nbInsert Insert a blank record
Delete nbDelete Delete the current record
Edit nbEdit Permit users to edit the current record
Post nbPost Post the current record
Cancel nbCancel Cancel the current edit
Refresh nbRefresh Refresh the data in the dataset
一个好方法是把DBNavigator的Visabled属性设置为False,自己在按钮的事件中调用它的方法。
3楼说的:"一个好方法是把DBNavigator的Visabled属性设置为False,自己在按钮的事件中调用它的方法。"
我正是想这么做,方便,能省好多事。
可是,
我在按钮的onclick下加了代码 DBNavigator1.BtnClick(2);
编译通不过,出现错误提示
[Error]:Incompatible types: 'TNavigateBtn' and 'Integer'
这是怎么回事,该怎么解决呢?
nbFirst
nbPrior
nbNext
nbLast
nbInsert
nbDelete
nbEdit
nbPost
nbCancel
Refresh