TDBNavigator在删除数据之前默认时有提示的。你也可以这样写: procedure TForm1.DBNavigator1BeforeAction(Sender: TObject; Button: TNavigateBtn); begin if Button = nbDelete then begin if Application.MessageBox('Are you sure to delete this record?','Information',MB_YESNO+MB_ICONQUESTION)=IDNO then exit; end; end;
谢谢!
procedure TForm1.DBNavigator1BeforeAction(Sender: TObject;
Button: TNavigateBtn);
begin
if Button = nbDelete then
begin
if Application.MessageBox('Are you sure to delete this record?','Information',MB_YESNO+MB_ICONQUESTION)=IDNO then exit;
end;
end;