J
johnrain
Unregistered / Unconfirmed
GUEST, unregistred user!
在一个单元中我:当函数如下声明时:提示找不到‘findcomponent’函数;
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs;
type
TForm1 = class(TForm)
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
Function Box(tt:integer):Tbutton;
begin
//......
Result:=TButton( FindComponent('Button1'));
end;
end.
而当我如下声明时:则没有问题
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs;
type
TForm1 = class(TForm)
private
{ Private declarations }
public
Function Box(tt:integer):Tbutton;
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
Function TForm1.Box(tt:integer):Tbutton;
begin
//......
Result:=TButton( FindComponent('Button1'));
end;
end.
请问这是这么回事??!!
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs;
type
TForm1 = class(TForm)
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
Function Box(tt:integer):Tbutton;
begin
//......
Result:=TButton( FindComponent('Button1'));
end;
end.
而当我如下声明时:则没有问题
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs;
type
TForm1 = class(TForm)
private
{ Private declarations }
public
Function Box(tt:integer):Tbutton;
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
Function TForm1.Box(tt:integer):Tbutton;
begin
//......
Result:=TButton( FindComponent('Button1'));
end;
end.
请问这是这么回事??!!