All Delphi

Everything You Want To Know From VCL, Tips To Snippet All Everything About Delphi And CodeGear Related

    Search

  • Sponsors

  • Spottt
    Spottt

How To Create A Roll Up Form (with animation)

28th June 2008

hello, alldelphi.com reader todays tips is .. how to create a roll up form with animation. sure we now there are several component that can do that trick such as billenium and also one of the JEDI component. But surely if we can do it our self why buy or used another component right ?
so for the curiosity sake let see the code below..

type
   TForm1 = class(TForm)
   private
     fOldClientHeight: Integer;
     procedure WMNCRButtonDown(var Msg: TWMNCRButtonDown) ; message WM_NCRBUTTONDOWN;
   public

   end;

var
   Form1: TForm1;

implementation
{$R *.dfm}

procedure TForm1.WMNCRButtonDown(var Msg: TWMNCRButtonDown) ;
var
   h : integer;
begin
   if (Msg.HitTest = HTCAPTION) then
   begin
      if (ClientHeight = 0) then
      begin
         for h := 0 to fOldClientHeight do ClientHeight := h;
         Application.ProcessMessages;
      end  else
      begin
         fOldClientHeight := ClientHeight;
         for h := fOldClientHeight downto 0 do ClientHeight := h;
         Application.ProcessMessages;
      end;
   end;
end;

Well alldelphi.com readers hope it was usefull for you all

Rate this:
2.7

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>