delphi里我想做一个推出关闭时的提示程序,麻烦各位帮忙解决下
unitUnit1;interfaceusesWindows,Messages,SysUtils,Variants,Classes,Graphics,Controls,F...
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs;
type
TForm1 = class(TForm)
private
{ Private declarations }
public
{ Public declarations }
end;
var Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.FormCloseQuery(Sender: TObject;var CanClose: Boolean);
begin
if MessageDlg('还有未保存文件,是否关闭?’,mtWarning,[mbYes,mbNo],0)=6 idyes then
CanClose:=true
else
CanClose:=false;
end;
end.
这个不能运行,在.FormCloseQuery这个下面有红线,提示form1doesn't contain a member named "FormCloseQuery"
麻烦帮忙看下哪出错了,谢谢 展开
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs;
type
TForm1 = class(TForm)
private
{ Private declarations }
public
{ Public declarations }
end;
var Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.FormCloseQuery(Sender: TObject;var CanClose: Boolean);
begin
if MessageDlg('还有未保存文件,是否关闭?’,mtWarning,[mbYes,mbNo],0)=6 idyes then
CanClose:=true
else
CanClose:=false;
end;
end.
这个不能运行,在.FormCloseQuery这个下面有红线,提示form1doesn't contain a member named "FormCloseQuery"
麻烦帮忙看下哪出错了,谢谢 展开
展开全部
改一下,就行了
if MessageDlg('还有未保存文件,是否关闭?',mtWarning,[mbYes,mbNo],0)=6 idyes then
CanClose:=true
else
CanClose:=false;
if MessageDlg('还有未保存文件,是否关闭?',mtWarning,[mbYes,mbNo],0)=6 idyes then
CanClose:=true
else
CanClose:=false;
更多追问追答
追问
[DCC Error] Unit1.pas(24): E2003 Undeclared identifier: 'FormCloseQuery'这有问题。
不过后面那没事了,是这个'符号的问题吗?谢谢你,希望能再帮忙看看
追答
是的,你弄成了中文单引号,它应该是英文单引号。注意,除非是两个英文单引号括起来的部分,DELPHI代码拒绝一切中文标点符号。
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询