CJC Delphi 技巧馆's Archiver

cjc Posted at 2018-9-20 10:55

Form in form, 把一个Form包含在另一个Form中 (2005.9.2)

Form in form, 把一个Form包含在另一个Form中

  protected
    procedure CreateParams(var Params: TCreateParams); override;
    procedure WMNCLButtonDown(var Msg: TWMNCLButtonDown); message WM_NCLBUTTONDOWN;



procedure TFormSearch.CreateParams(var Params: TCreateParams);
begin
  inherited CreateParams(Params);
  with Params do begin
    WndParent := Application.MainForm.Handle;
    Style := (Style or WS_CHILD) and not (WS_POPUP);
  end;
  Parent :=  Application.MainForm;
end;

procedure TFormSearch.WMNCLButtonDown(var Msg: TWMNCLButtonDown);
begin
  inherited;
  //Self.Parent.
  //Form1.BroadcastDeActivate;
  PostMessage(Self.Handle, WM_NCACTIVATE, integer(true), 0);
end;

Page: [1]
CJC好玩背单词最新版本 - 是目前最好的背单词软件,游戏好玩,功能强大,词库众多,还有真人语音,免费下载,免费试用 !

Powered by Discuz! Archiver 6.1.0  © 2001-2007 Comsenz Inc.