P
pie
Unregistered / Unconfirmed
GUEST, unregistred user!
在《Delphi 4 编程技术内幕》(机械工业出版社Charlie Calvert 著)一书中:P404例子 Music程序
我的源程序盘丢失: 无法看懂!! 望 各位帮助!!!!!!!!
方法是:
unit UnitChild;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs;
type
TFormChild = class(TForm)
private
{ Private declarations }
procedure loaded;
override;
procedure CreateParams(var Params: TCreateParams);
override;
public
{ Public declarations }
end;
var
FormChild: TFormChild;
implementation
{$R *.DFM}
procedure TFormChild.loaded;
begin
inherited loaded;
Visible:= false;
Position:=poDefault;
BorderIcons :=[];
BorderStyle :=bsNone;
HandleNeeded;
SetBounds(0,0,Width,Height);
end;
procedure TFormChild.CreateParams(var Params: TCreateParams);
begin
inherited CreateParams(Params);
// Params.WndParent:=(Owner as TForm).Handle;
Params.Style:=WS_CHILD or WS_CLIPSIBLINGS;
Params.X:=0;
Params.Y:=0;
end;
end.
然后建立Form1 = class(TFormChild)
在 FormMain中:
procedure TFormMian.FormCreate(Sender: TObject);
begin
Form1 := TFormReturnBook.Create (Self);
Forms1.show;
end;
然后在Botton.Click中:
Form1.bringToFront;
// A
Caption:='????????'+Form1.Caption;
// B
但是!!!!!!!!!!!:
A 语句执行不成功
B 语句执行成功!
如何解决!!!
我的源程序盘丢失: 无法看懂!! 望 各位帮助!!!!!!!!
方法是:
unit UnitChild;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs;
type
TFormChild = class(TForm)
private
{ Private declarations }
procedure loaded;
override;
procedure CreateParams(var Params: TCreateParams);
override;
public
{ Public declarations }
end;
var
FormChild: TFormChild;
implementation
{$R *.DFM}
procedure TFormChild.loaded;
begin
inherited loaded;
Visible:= false;
Position:=poDefault;
BorderIcons :=[];
BorderStyle :=bsNone;
HandleNeeded;
SetBounds(0,0,Width,Height);
end;
procedure TFormChild.CreateParams(var Params: TCreateParams);
begin
inherited CreateParams(Params);
// Params.WndParent:=(Owner as TForm).Handle;
Params.Style:=WS_CHILD or WS_CLIPSIBLINGS;
Params.X:=0;
Params.Y:=0;
end;
end.
然后建立Form1 = class(TFormChild)
在 FormMain中:
procedure TFormMian.FormCreate(Sender: TObject);
begin
Form1 := TFormReturnBook.Create (Self);
Forms1.show;
end;
然后在Botton.Click中:
Form1.bringToFront;
// A
Caption:='????????'+Form1.Caption;
// B
但是!!!!!!!!!!!:
A 语句执行不成功
B 语句执行成功!
如何解决!!!