按下dbnavigator删除按钮后,是否可以根据决定中止记录的删除?
我检查了beforeAction事件

if Button = nbDelete then
  //check if not OK then

Button := nbCancel;

但这是行不通的。有帮助吗?

我正在使用DelPhi XE2, anyDac Components

最佳答案

使用 BeforeAction 事件

procedure TForm1.DBNavigator1BeforeAction(Sender: TObject; Button: TNavigateBtn);
begin
  if Button = nbDelete then
  begin
    if MessageDlg('Confirm delete now?', mtConfirmation, [mbYes,mbNo], 0) = mrNo then
    begin
      Abort;
    end;
  end;
end;

关于delphi - 按下dbnavigator删除按钮后,如何根据决策中止记录的删除?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/14301646/

10-12 12:43
查看更多