hide the form

I'd like to hide the form,while keeping it's objects appear,such as images,pannels ..etc.
 
  How can I do so ?
I prefer a way doesn't depend on a component.
alim_mazeAsked:
Who is Participating?
 
hubdogConnect With a Mentor Commented:
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls;

type
  TForm1 = class(TForm)
    Button1: TButton;
    Button2: TButton;
  private
    { Private declarations }
    procedure HideForm(var Msg:TMessage);message wm_eraseBkGnd;
    procedure Createparams(var Params:TCreateParams);override;
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.DFM}

procedure TForm1.HideForm(var Msg: TMessage);
begin

  msg.result:=1;
end;

procedure TForm1.Createparams(var Params: TCreateParams);
begin
  inherited;
  with params do
  begin
    exstyle:=exstyle or WS_EX_TRANSPARENT;
    style:=style and (not WS_CLIPCHILDREN);
  end;
end;

end.
if your want the form without border and caption, you can set the form.borderstyle:=bsnone;

good luck

hubdog
0
 
ptmcompCommented:
Does it really work? I think I had to put a UpdateWindow(0) before msg.result=1. But perhaps I'm wrong.
0
 
anasexpertCommented:
hi everybody
 Yes Hubdog's way works well.
thank's for you Hubdog.
0
All Courses

From novice to tech pro — start learning today.