如何把dll中窗体的parent设置为引用程序的窗体. ( 积分: 50 )

  • 主题发起人 主题发起人 lsfbad
  • 开始时间 开始时间
L

lsfbad

Unregistered / Unconfirmed
GUEST, unregistred user!
1.dll
/////project1.dpr/////////
uses
unit1.pas in 'unit1.pas'{form1}

function myform:tform2;
begin
result:=tform2.Create(nil);
end;
exports
myform;
////unit1.pas///////
type
TForm1 = class(TForm)
Button1: TButton;
Label1: TLabel;
Memo1: TMemo;
procedure Button1Click(Sender: TObject);
procedure Label1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }

end;
tform2 = class (tform1);
-----------------------------
调用程序;
type
TForm1 = class(TForm)
Button1: TButton;
Panel1: TPanel;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
function myform:tform;external 'project2.dll';

procedure TForm1.Button1Click(Sender: TObject);
var
gaga:tform;
begin
gaga:=myform;
gaga.Show;
end;

如何能把其中gaga的父窗体设为 form1(调用方)
 
1.dll
/////project1.dpr/////////
uses
unit1.pas in 'unit1.pas'{form1}

function myform:tform2;
begin
result:=tform2.Create(nil);
end;
exports
myform;
////unit1.pas///////
type
TForm1 = class(TForm)
Button1: TButton;
Label1: TLabel;
Memo1: TMemo;
procedure Button1Click(Sender: TObject);
procedure Label1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }

end;
tform2 = class (tform1);
-----------------------------
调用程序;
type
TForm1 = class(TForm)
Button1: TButton;
Panel1: TPanel;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
function myform:tform;external 'project2.dll';

procedure TForm1.Button1Click(Sender: TObject);
var
gaga:tform;
begin
gaga:=myform;
gaga.Show;
end;

如何能把其中gaga的父窗体设为 form1(调用方)
 
你的意思是不是想把gaga显示在form1中啊?那可以设置form1为mdiform,gaga 设为mdichild
 
Windows.SetParent
 

Similar threads

S
回复
0
查看
751
SUNSTONE的Delphi笔记
S
I
回复
0
查看
831
import
I
I
回复
0
查看
673
import
I
后退
顶部