«« Site Rescued »»

While the site is still going to move from its current host, a new site will now take its place. More Info.

The new site may have less content, but the core will now remain. And it will now play nicely with phones! Keep an eye on the DelphiDabbler Blog for news.

» Help

How to fade forms in and out

   

This is more an aesthetical feature but you can easily add fading in / out to your project with this simple snippet.

To fade in:

var
  j : Integer;
begin
  j := 0;
  while j < 255 do 
   j := j + 1;
   Form1.AlphaBlendValue := j;
end;

To fade out

var
  j : Integer;
begin
  j := 255;
  while j > 0 do 
    j := j - 1;
    Form1.AlphaBlendValue := j;
  end;
end;

You could refactor this code to work with a timer rather than using a loop.

Code slightly modified and corrected by Peter Johnson.

Author: K Smith
Contributor: K Smith
Added: 2011-01-15
Last updated: 2011-01-15

« Return to contents »