Konuyu Oyla:
  • Toplam: 0 Oy - Ortalama: 0
  • 1
  • 2
  • 3
  • 4
  • 5
DELPHİ PROGRAM FORMUNUZU TİTRETİN!
#1
Delphi'de hazırladığınız programa MSN'de olduğu gibi bazı koşullarda kullanıcıyı uyarmak ya da olaya mizahi bir özellik katmak için titreşim ekleyebilirsiniz.

Yapmanız gereken şey bu kodları kullanmak:


PHP Kod:
Kod:
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.X;
      theWinControl.Top := theWinControl.Top + P.Y;
      theWinControl.Update;
      Sleep(25); // ???
    end;
end;
theWinControl.Left := orgLeft;
theWinControl.Top := orgTop;
end; 



Ya da bunu formunuza bir timer nesnesi koyarak da yapabilirsiniz. Nasıl mı? Timer'ı calıştırıp falan ms (milisaniye) aralıkla formun yerini değiştirmesini sağlayarak. Tabi bu da formun ekrandaki yerlerini kodumuzda farklı tanımlayarak yapılabilir. Bence hem bu kodu deneyin, hem de timer'ı... Oldukça eğlenceli bir çalışma olacağını düşünüyorum.

Saygılarımla, herkese kolay gelsin...
Ara
Cevapla }}}}


Hızlı Menü:


Şu anda bu konuyu okuyanlar: 2 Ziyaretçi

Online Shopping App
Online Shopping - E-Commerce Platform
Online Shopping - E-Commerce Platform
Feinunze Schmuck Jewelery Online Shopping