unit unit1;interfaceuses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;type
TForm1 = class(TForm)
Button1: TButton;
procedure Dyn_ButtonClick(Sender: TObject);
procedure Create_Form(AOwner: TComponent);
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;
Dyn_Form: TForm;
Dyn_button: TButton;
Dyn_label: TLabel;
implementation{$R *.dfm}
procedure TForm1.Dyn_ButtonClick(Sender: TObject);
begin
Dyn_Form.Dyn_label.Caption:='停止';
end;procedure TForm1.Create_Form(AOwner: TComponent);
begin if assigned(Dyn_Form) then exit;
Dyn_Form:= TForm.Create(AOwner);
with Dyn_Form do
begin
try
Dyn_button := TButton.Create(Dyn_Form);
with Dyn_button do
begin
Parent := Dyn_Form;
onclick:=Dyn_ButtonClick;
end;
Dyn_label := TLabel.Create(Dyn_Form);
with Dyn_label do
begin
top:=50;
Parent := Dyn_Form;
caption:='开始';
end;
except
end;
end;end;procedure TForm1.Button1Click(Sender: TObject);
begin
Create_Form(nil);
Dyn_Form.Show;
end;end.
编译时提示错误:
[Error] Unit1.pas(32): Undeclared identifier: 'Dyn_lable'
[Fatal Error] Project1.dpr(5): Could not compile used unit 'Unit1.pas'请高手帮忙解决!!!
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;type
TForm1 = class(TForm)
Button1: TButton;
procedure Dyn_ButtonClick(Sender: TObject);
procedure Create_Form(AOwner: TComponent);
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;
Dyn_Form: TForm;
Dyn_button: TButton;
Dyn_label: TLabel;
implementation{$R *.dfm}
procedure TForm1.Dyn_ButtonClick(Sender: TObject);
begin
Dyn_Form.Dyn_label.Caption:='停止';
end;procedure TForm1.Create_Form(AOwner: TComponent);
begin if assigned(Dyn_Form) then exit;
Dyn_Form:= TForm.Create(AOwner);
with Dyn_Form do
begin
try
Dyn_button := TButton.Create(Dyn_Form);
with Dyn_button do
begin
Parent := Dyn_Form;
onclick:=Dyn_ButtonClick;
end;
Dyn_label := TLabel.Create(Dyn_Form);
with Dyn_label do
begin
top:=50;
Parent := Dyn_Form;
caption:='开始';
end;
except
end;
end;end;procedure TForm1.Button1Click(Sender: TObject);
begin
Create_Form(nil);
Dyn_Form.Show;
end;end.
编译时提示错误:
[Error] Unit1.pas(32): Undeclared identifier: 'Dyn_lable'
[Fatal Error] Project1.dpr(5): Could not compile used unit 'Unit1.pas'请高手帮忙解决!!!
解决方案 »
- delphi7调用外部exe问题
- 怎么在DELPHI7 中 查找FTP中的文件
- midas三层架构,使用socketconnection无法连接,是什么原因?部分电脑可以连接部分电脑不能连接,可以排除软件问题。
- ADOQuery控件的events中的afterscroll事件为什么不能增加?
- 怎样杀掉一个进程,急求多种方法!!!
- 谁能解决Rave保存为PDF文件时,汉字变成乱码的问题?
- 十六进制如何转换为十进制
- 如何设置stringgrid的cells为红色,或则其他什么颜色!
- Delphi中关于卸载u盘的问题
- 小弟最近装上delphi5,为什么控件图标乱了,有没有方法解决?
- 多线程数据库插入问题
- 求救!想了一个上午都想不明白......
改成 Dyn_label.Caption:='停止';