was ist neu ¦  programmier tips ¦  indy artikel ¦  intraweb artikel ¦  informationen ¦  links ¦  interviews
 sonstiges ¦  tutorials ¦  Add&Win Gewinnspiel

Tips (1541)

Dateien (137)
Datenbanken (90)
Drucken (35)
Grafik (114)
IDE (21)
Indy (5)
Internet / LAN (130)
IntraWeb (0)
Mathematik (76)
Multimedia (45)
Oberfläche (107)
Objekte/
ActiveX (51)

OpenTools API (3)
Sonstiges (126)
Strings (83)
System (266)
VCL (242)

Tips sortiert nach
Komponente


Tip suchen

Tip hinzufügen

Add&Win Gewinnspiel

Werbung

51 Visitors Online


 
...Formulare mit Animationseffekte anzeigen?
Autor: Agus Made
Homepage: http://www.agusmade.co.nr
[ Tip ausdrucken ]  

Tip Bewertung (37):  
     


//This code to make form show with animation effect

//sorry for my poor english..

procedure TForm1.animin(Sender: TObject);

  procedure delay(msec: Longint);
  var
    
start, stop: Longint;
  begin
    
start := GetTickCount;
    repeat
      
stop := GetTickCount;
      Application.ProcessMessages;
    until (stop - start) >= msec;
  end;
var 
  
maxx, maxy: Integer;

  MyHand: HWND;
  MyDc: HDC;
  MyCanvas: TCanvas;
  hal, hat, hak, haa: Integer;
begin
  
maxx := (Sender as TForm).Width;
  maxy := (Sender as TForm).Height;
  hal  := 2;
  hat  := 2;

  MyHand   := GetDesktopWindow;
  MyDc     := GetWindowDC(MyHand);
  MyCanvas := TCanvas.Create;
  MyCanvas.Handle := MyDC;
  MyCanvas.Brush.Color := (Sender as TForm).Color;

  repeat
    if 
hat + (maxy div 24) >= maxy then
    begin
      
hat := maxy
    end
    else
    begin
      
hat := hat + (maxy div 24);
    end;

    if hal + (maxx div 24) >= maxx then
    begin
      
hal := maxx
    end
    else
    begin
      
hal := hal + (maxx div 24);
    end;
    hak := (Sender as TForm).Left + ((Sender as TForm).Width div 2) - (hal div 2);
    haa := (Sender as TForm).Top + ((Sender as TForm).Height div 2) - (hat div 2);
    MyCanvas.Rectangle(hak, haa, hak + hal, haa + hat);
    delay(10);
  until (hal = maxx) and (hat = maxy);
  (Sender as TForm).Show;
end;



procedure TForm1.Button1Click(Sender: TObject);
begin
  
animin(form2);
end;



procedure TForm1.Button2Click(Sender: TObject);
begin
  
animin(form3);
end;


 

Bewerten Sie diesen Tipp:

dürftig
ausgezeichnet


Copyright © by SwissDelphiCenter.ch
All trademarks are the sole property of their respective owners