发信人: redfox (Z掉了几乎所有的版...), 信区: BorlandDev
标 题: Delphi编程 -- 2.13 得到Quicken 风格的FORMS
发信站: 哈工大紫丁香 (2000年09月01日13:33:15 星期五), 站内信件
怎样得到Quicken 风格的FORMS
Quicken style forms ,How to?
----------------------
REPLY1:
Every TPageControl is "dynamic":
TabSheet := TTabSheet.Create(Self);
TabSheet.PageControl := MyPageControl
----------------------
REPLY2:
You can just embed the form in the TabSheet:
MyForm := TMyForm.Create(Application);
MyForm.Parent := TabSheet;
MyForm.Align := alClient;
MyForm.BorderStyle := bsNone;
MyForm.Show;
----------------------
REPLY3:
In Delphi you would do this by making a panel on the main form the
container for all your forms (or most of them). Then, when the forms
open, they open within the container.
Here is some code that I use:
{ First, create a unit to define the "child form" that all subsequent
forms inherit... }
unit ChildF;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, StdCtrls;
type
TChildForm = class(TForm)
protected
procedure Loaded; override;
procedure CreateParams(var Params: TCreateParams); override;
end;
implementation
{ The unit has to use your main form... }
uses alloc1;
procedure TChildForm.Loaded;
begin
inherited Loaded;
Visible := False;
Position := poDefault;
BorderIcons := [];
BorderStyle := bsNone;
HandleNeeded;
Parent := TFrmMaster(Application.MainForm).pnlChild;
align := alClient;
end;
procedure TChildForm.CreateParams(var Params : TCreateParams);
begin
Inherited CreateParams(Params);
With Params do
begin
{ make the parent of the form the panel in your main form }
WndParent := TFrmMaster(Application.MainForm).pnlChild.Handle;
Style := (Style or ws_Child or ws_ClipSiblings) and not
ws_popup;
end;
end;
end.
--
※ 来源:·哈工大紫丁香 bbs.hit.edu.cn·[FROM: 202.118.227.107]
Powered by KBS BBS 2.0 (http://dev.kcn.cn)
页面执行时间:3.539毫秒