Mega Code Archive

 
Categories / Delphi / Forms
 

Shaking a Form !

Title: Shaking a Form ! Hi Just put a button in your form and insert these commands in the OnClick Event ! Have Fun ;) ------------------------------------------------------------------------ procedure TForm1.Button1Click(Sender: TObject); var N : Integer; //Counter TL,TT : Integer; //Backup for LEFT and TOP of teh FORM begin TL := Left; //Backups Left of the Form TT := Top; //Backups Top of the Form //********************************************************************* for N:=1 to 40 do begin //Counter Time Left:= (TL-10) + (Random(20)); {Shake Range in Horizontal Driection} Top := (TT-10) + (Random(20)); {Shake Range in Vertical Driection} end; //********************************************************************* Left := TL; //Restores Left of the Form Top := TT; //Restores Top of the Form end;