28-01-2008, 12:32
|
#1 (permalink)
|
|
Banlandı
Üyelik tarihi: 22-11-2007
Nerden: napıcan ziyaretemi geLcen!!
Mesajlar: 0
Üye No: 11416
Ruh halim:
Rep Gücü : 0
Rep Puanı : 0
Rep Seviyesi : 
|
Titreşim MSN deki Gibi
Alıntı:
// titreşim örneği
// formu veya bir kontrolü titretin
procedure NudgeWindow(theWinControl: TWinControl; noN: integer; wSound: Boolean);
var
i, j, A, AK2: integer;
orgLeft, orgTop: integer;
P: array[1..9] of TPoint;
begin
orgLeft := theWinControl.Left;
orgTop := theWinControl.Top;
A := 5; AK2 := Round(A * sqrt(2));
// sekizgen koordinatlari
P[1] := Point(0, A);
P[2] := Point(-AK2, -AK2);
P[3] := Point(A, 0);
P[4] := Point(-AK2, AK2);
P[5] := Point(0, -A);
P[6] := Point(AK2, AK2);
P[7] := Point(-A, 0);
P[8] := Point(AK2, -AK2);
P[9] := Point(0, A);
// uses kismina MMSystem
if wSound then
PlaySound(PChar('SES'), 0, SND_RESOURCE or SND_ASYNC);
for j:=1 to abs(noN) do
begin
theWinControl.Left := orgLeft;
theWinControl.Top := orgTop;
for i:=1 to 9 do
begin
theWinControl.Left := theWinControl.Left + P[i].X;
theWinControl.Top := theWinControl.Top + P[i].Y;
theWinControl.Update;
Sleep(25); // 
end;
end;
theWinControl.Left := orgLeft;
theWinControl.Top := orgTop;
end;
/// kullanimi
NudgeWindow(Form1, 3, true);
|
.
|
|
|