我现在有个一个工程文件,里面现在有1个窗体文件(dfm),由于我以前已做好了一个窗体文件A(包括A.pas,A.dfm文件),我现在要把A文件加到这个工程里面去,请问大家怎么样加进去?
我试过在"add project"菜单里面,加进工程,也能加进去,但是使用show方法时,提示A为非发标示符,我不知道问题出在那里,请大家告诉我,我等着。
源程序如下:
unit Unit1;interfaceuses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;type
TForm1 = class(TForm)
Button1: TButton;
procedure FormCreate(Sender: TObject);
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;implementationuses unitAboutFrm;{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
AboutForm.show;//就是这话提示出错,说AboutForm没有定义.
end;end.program Project1;uses
Forms,
Unit1 in 'Unit1.pas' {Form1},
unitAboutFrm in 'unitAboutFrm.pas' {AboutForm};{$R *.res}begin
Application.Initialize;
Application.CreateForm(TForm1, Form1);
Application.Run;
end.unit unitAboutFrm;interfaceuses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, jpeg, ExtCtrls, StdCtrls, ShellAPI;type
TAboutForm = class(TForm)
Panel1: TPanel;
Panel2: TPanel;
Button1: TButton;
Panel3: TPanel;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Image1: TImage;
Label5: TLabel;
Label6: TLabel;
Label7: TLabel;
Label8: TLabel;
Label9: TLabel;
Label10: TLabel;
Label11: TLabel;
procedure Label11Click(Sender: TObject);
procedure Label7Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;procedure ShowAboutForm();implementation{$R *.dfm}
procedure ShowAboutForm();
begin
with TAboutForm.Create(Application) do
try
ShowModal;
finally
Free;
end;
end;procedure TAboutForm.Label11Click(Sender: TObject);
const
lsStr: string = 'http://www.wasion.com';
begin
ShellExecute(Application.Handle, 'open', PChar(lsStr), NIL, NIL, SW_SHOWNORMAL);
end;procedure TAboutForm.Label7Click(Sender: TObject);
const
lsStr: string = 'mailto: [email protected]';
begin
ShellExecute(Application.Handle, 'open', PChar(lsStr), NIL, NIL, SW_SHOWNORMAL);
end;end.请大家看看这个程序代码是不是有错误。
我很急...
我试过在"add project"菜单里面,加进工程,也能加进去,但是使用show方法时,提示A为非发标示符,我不知道问题出在那里,请大家告诉我,我等着。
源程序如下:
unit Unit1;interfaceuses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;type
TForm1 = class(TForm)
Button1: TButton;
procedure FormCreate(Sender: TObject);
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;implementationuses unitAboutFrm;{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
AboutForm.show;//就是这话提示出错,说AboutForm没有定义.
end;end.program Project1;uses
Forms,
Unit1 in 'Unit1.pas' {Form1},
unitAboutFrm in 'unitAboutFrm.pas' {AboutForm};{$R *.res}begin
Application.Initialize;
Application.CreateForm(TForm1, Form1);
Application.Run;
end.unit unitAboutFrm;interfaceuses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, jpeg, ExtCtrls, StdCtrls, ShellAPI;type
TAboutForm = class(TForm)
Panel1: TPanel;
Panel2: TPanel;
Button1: TButton;
Panel3: TPanel;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Image1: TImage;
Label5: TLabel;
Label6: TLabel;
Label7: TLabel;
Label8: TLabel;
Label9: TLabel;
Label10: TLabel;
Label11: TLabel;
procedure Label11Click(Sender: TObject);
procedure Label7Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;procedure ShowAboutForm();implementation{$R *.dfm}
procedure ShowAboutForm();
begin
with TAboutForm.Create(Application) do
try
ShowModal;
finally
Free;
end;
end;procedure TAboutForm.Label11Click(Sender: TObject);
const
lsStr: string = 'http://www.wasion.com';
begin
ShellExecute(Application.Handle, 'open', PChar(lsStr), NIL, NIL, SW_SHOWNORMAL);
end;procedure TAboutForm.Label7Click(Sender: TObject);
const
lsStr: string = 'mailto: [email protected]';
begin
ShellExecute(Application.Handle, 'open', PChar(lsStr), NIL, NIL, SW_SHOWNORMAL);
end;end.请大家看看这个程序代码是不是有错误。
我很急...
解决方案 »
- delphi这样的控件怎么做
- key=38 ,40是什么意思??
- CxGrid怎样判断是否获得焦点?请大家帮忙看看.
- 用shellexecute函数调用windows命令行参数怎样调???
- 欧洲杯 B组:法国VS瑞士 猜中200分!!
- 设置了datamodule1后,像执行一个语句,将另外一个表中的数据插入到当前表中,如何操作?
- 有什么简单方法可以将listview里面的记录保存到文件中?
- delphi和asp结合怎么样,这样好不好,都有什么利于弊,有什么前景么
- 怎么样才能在桌面上画个红色镶边蓝色填充期间的图形?
- pchar能向String转换吗?
- 数据库的执行速度问题!
- 最简单问题:!!!login 窗口
var
AboutFrm: TAboutFrm;