在BeforDelete事件写代码 if application.messagebox('确定要铲除吗?','提示',mb_ok+mb_iconquestion)<>idok then abort;
if MessageBox(Handle,'真的要删除吗?','请确认',MB_YESNO+MB_ICONQUESTION)=IDYES then //在这里写入删除代码
怎么可能?在beforedelete时间里写代码就可以了啊
如果你使用了DBNavigator控件,打开它的源代码(在Delphi5\Source\VCL目录下打开dbctrls.pas文件),在BtnClick(Index: TNavigateBtn);方法中可以清楚地看到里面有如下代码: bDelete: if not FConfirmDelete or (MessageDlg(SDeleteRecordQuestion, mtConfirmation, mbOKCancel, 0) <> idCancel) then Delete; 将其中的MessageDlg修改成自己的对话框代码即可,其中SDeleteRecordQuestion是一个常量,定义在DbConsts单元
if application.messagebox('确定要铲除吗?','提示',mb_ok+mb_iconquestion)<>idok then abort;
//在这里写入删除代码
bDelete:
if not FConfirmDelete or
(MessageDlg(SDeleteRecordQuestion, mtConfirmation,
mbOKCancel, 0) <> idCancel) then Delete;
将其中的MessageDlg修改成自己的对话框代码即可,其中SDeleteRecordQuestion是一个常量,定义在DbConsts单元