Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- unit CHILDWIN;
- interface
- uses Windows, Classes, Graphics, Forms, Controls, StdCtrls;
- type
- TMDIChild = class(TForm)
- private
- { Private declarations }
- public
- { Public declarations }
- procedure CreateWindowHandle(const Params: TCreateParams); override;
- end;
- implementation
- {$R *.dfm}
- procedure TMDIChild.CreateWindowHandle(const Params: TCreateParams);
- begin
- inherited CreateWindowHandle(Params);
- SetWindowLong(Handle, GWL_EXSTYLE, WS_EX_TOOLWINDOW);
- end;
- end.
- TMyForm = class(TForm)
- private
- FCurrentModule : TFrame;
- public
- property CurrentModule : TFrame read FModule write SetCurrentModule;
- end;
- procedure TMyForm.SetCurrentModule(ACurrentModule : TFrame);
- begin
- if assigned(FCurrentModule) then
- FreeAndNil(FCurrentModule); // You could cache this if you wanted
- FCurrentModule := ACurrentModule;
- if assigned(FCurrentModule) then
- begin
- FCurrentModule.Parent := Self;
- FCurrentModule.Align := alClient;
- end;
- end;
- MyForm.CurrentModule := TSomeFrame.Create(nil);
Add Comment
Please, Sign In to add comment