在Form的onclosequery事件中
if k<>0 then
begin
showmessage('can/t close');
canclose:=false;
end;
if k<>0 then
begin
showmessage('can/t close');
canclose:=false;
end;
解决方案 »
- 压缩ACCESS数据库问题
- 数据库内存表问题。。。
- 定义这样的数组有什么问题没有?如果没有应该注意什么?谢谢!
- 将word文档的表格增加一行
- 有没有这样的结构try..except..finally..end
- 简单问题,在线
- 关于数据筛选的问题。谢谢!
- ......一个弱弱的问题.....(在线等。。。)
- 如何使窗体透明
- 哪位知道folder.htt是个什么东西???怎么每打开一个文件夹都会出现??
- 急!这个问题该如何解决,,,请问各位高手!!!无法为更新行集定位:一些值可能已居最后读取扣改变.
- 为什么说variant does not reference an automation object?
在onclosequery里面加上自己的条件
符合条件
canclose:=true;
不符合条件
canclose:=false;
ok!
begin
IF application.MessageBox('请确定已存盘?','信息提示',mb_okcancel+MB_ICONINFORMATION)=idok then
canclose:=true
else
canclose:=false;
end;
begin
canclose:=条件;
end;
If 不满足条件 Then
Abort.
"你确定要退出管理终端吗?", "退出系统通知",
MessageBoxButtons.YesNo, MessageBoxIcon.Question);
if (dr!= System.Windows.Forms.DialogResult.Yes)
{
e.Cancel=true;
}
{
System.Windows.Forms.DialogResult dr = MessageBox.Show(this,
"你确定要退出管理终端吗?", "退出系统通知",
MessageBoxButtons.YesNo, MessageBoxIcon.Question);
if (dr!= System.Windows.Forms.DialogResult.Yes)
{
e.Cancel=true;
}
}
CloseQuery事件更高级。比Close高级一些。或直接栏API