Y
yorks.hl
Unregistered / Unconfirmed
GUEST, unregistred user!
我刚刚开始学习DELPHI7,以前用FOXPRO做了一个程序,想将它转到DELPHI。
建立好一个主窗口和几个子窗口,子窗口不是自动创建,想通过主窗口的按钮来调用子窗口,同时隐藏主窗口,保证只有一个子窗口运行,子窗口结束时释放所有资源和后台数据库的连接,返回主窗口。请举一个例子。
program hxkq;
uses
Forms,
main in 'main.pas' {Frmmain},
dept in 'dept.pas' {Frmdept},
emp in 'emp.pas' {Frmemp};
{$R *.res}
begin
Application.Initialize;
Application.CreateForm(TFrmmain, Frmmain);
Application.Run;
end.
unit main;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Buttons;
type
TFrmmain = class(TForm)
BitBtndept: TBitBtn;
BitBtnemp: TBitBtn;
BitBtn3: TBitBtn;
BitBtn4: TBitBtn;
BitBtn5: TBitBtn;
BitBtn6: TBitBtn;
procedure BitBtndeptClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Frmmain: TFrmmain;
implementation
{$R *.dfm}
procedure TFrmmain.BitBtndeptClick(Sender: TObject);
begin
Application.CreateForm(TFrmdept, Frmdept);
end;
end.
编译时:[错误] main.pas(33): Undeclared identifier: 'TFrmdept'
建立好一个主窗口和几个子窗口,子窗口不是自动创建,想通过主窗口的按钮来调用子窗口,同时隐藏主窗口,保证只有一个子窗口运行,子窗口结束时释放所有资源和后台数据库的连接,返回主窗口。请举一个例子。
program hxkq;
uses
Forms,
main in 'main.pas' {Frmmain},
dept in 'dept.pas' {Frmdept},
emp in 'emp.pas' {Frmemp};
{$R *.res}
begin
Application.Initialize;
Application.CreateForm(TFrmmain, Frmmain);
Application.Run;
end.
unit main;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Buttons;
type
TFrmmain = class(TForm)
BitBtndept: TBitBtn;
BitBtnemp: TBitBtn;
BitBtn3: TBitBtn;
BitBtn4: TBitBtn;
BitBtn5: TBitBtn;
BitBtn6: TBitBtn;
procedure BitBtndeptClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Frmmain: TFrmmain;
implementation
{$R *.dfm}
procedure TFrmmain.BitBtndeptClick(Sender: TObject);
begin
Application.CreateForm(TFrmdept, Frmdept);
end;
end.
编译时:[错误] main.pas(33): Undeclared identifier: 'TFrmdept'