在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;
解决方案 »
- 请教提交TWebBrowser按钮的问题,框架结构
- 关于delphi三层结构的疑问
- 请教高人-如何屏蔽指定的word菜单项目
- 高手!救救我~~~~~~~~~~~~~~~~~
- 请教:ADO 连接 SQL Server 问题
- 请问大侠:函数作为参数传递给DLL,函数自己所带参数传递有误,执行次数也不对?
- 基础OOP问题,关于 OVERLOAD + VIRTUAL...
- 关于界面的,希望各位大侠能帮下忙!
- delphi设计时控件显示原理
- 我现在用delphi写一个和字符叠加器带一个Wordover.exe,要和这个软件来通信;
- 急!这个问题该如何解决,,,请问各位高手!!!无法为更新行集定位:一些值可能已居最后读取扣改变.
- 为什么说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