在窗口的closequery事件加入如下代码即可: integer li_ret if dw_1.deletedcount() + dw_1.modifiedcount() 0 then li_ret = messagebox(注意,数据已经被修改,是否存盘?,Question!,YesNoCancel!) choose case li_ret case 1 if dw_1.update() = 1 then c
在窗口的closequery事件加入如下代码即可:
integer li_ret
if dw_1.deletedcount() + dw_1.modifiedcount() > 0 then
li_ret = messagebox(″注意″,″数据已经被修改,是否存盘?″,Question!,YesNoCancel!)
choose case li_ret
case 1
if dw_1.update() = 1 then
commit;
return 0
else
rollback;
messagebox(″出错″,″存盘时出错!请检查数据的正确性。″)
return 1
end if
case 2
return 0
case 3
return 1
end choose
end if
另外,还可以利用窗口的CloseQuery事件在用户关闭窗口时进行确认。在CloseQuery事件中加入脚本:
long ll_return
ll_return = MessageBox(″提示信息″,″确认退出吗?″, Question! , YesNo! , 1 )
if ll_return = 2 then
Return 1
else
Return 0
end if
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号