folder Tahribat.com Forumları
linefolder Delphi - Pascal
linefolder Delphi İçin Birkaç Örnek



Delphi İçin Birkaç Örnek

  1. KısayolKısayol reportŞikayet pmÖzel Mesaj
    adanakebap
    Khaine
    Khaine's avatar
    Kayıt Tarihi: 16/Temmuz/2005
    Erkek
    MP3 Çalar


    Code:


    if opendialog1.execute then
    mediaplayer1.filename:=(opendialog1.filename);
    mediaplayer1.open;
    mediaplayer1.displayİ:=panel1
    mediaplayer1.play;



    Animasyonlu Form Açılışı


    Code:


    kodu istediğiniz yere yazabilirsiniz.

    animatewindow(handle,500,aw_center);

    kod bu arkadaşlar.

    500: kaç milisaniyede gelsin isterseniz...

    aw_center: buraya nasıl gelsin isterseniz onu yazın..

    yani "aw_" yazın ctrl+space yapın orada neler yazılabilir görürsünüz..

    ayrıca aralarına or operatörü kullanabilirsiniz..

    animatewindow(handle,500,aw_ver_positive or aw_ver_negative or aw_center);
    falan gibi yani..



    Anolog Saat


    Code:


    procedure TForm1.Timer1Timer(Sender: TObject);
    begin
    Min_Check:=min;
    Hour_Check:=hour;
    tid:=timetostr(time);
    ss:= tid[7] +tid[8];
    sek:=strtoint(ss);
    m:= tid[4] +tid[5];
    min:=strtoint(m);
    h:= tid[1] +tid[2];
    hour:=strtoint(h);

    if (min_check <> min) then
    Min_Update:=true;

    if (Hour_Check <> Hour) then
    Hour_Update:=true;
    form1.Canvas.Pen.Width :=1;
    form1.Canvas.pen.Color:=clwhite;
    form1.Canvas.LineTo(strtoint(floattostr(oldx)),strtoint(floa ttostr(oldy))) ;
    form1.Canvas.LineTo(strtoint(floattostr(midx)),strtoint(floa ttostr(midy))) ;

    HourX1 := s * Cos((Pi / 180) * (30 * hour - 90)) + MidX;
    HourY1 := s * Sin((Pi / 180) * (30 * hour - 90)) + MidY;

    MinX1 := s * Cos((Pi / 180) * (6 * Min - 90)) + MidX;
    MinY1 := s * Sin((Pi / 180) * (6 * Min - 90)) + MidY;

    X1 := s * Cos((Pi / 180) * (6 * sek - 90)) + MidX;
    Y1 := s * Sin((Pi / 180) * (6 * sek - 90)) + MidY ;
    x:=int(x1);
    y:=int(y1);
    OldXMin := XMin ;
    OldYMin := YMin ;
    XMin:=int(MinX1);
    YMin:=int(MinY1);
    OldXHour:=XHour;
    OldYHour:=YHour;
    XHour:=int(HourX1);
    YHour:=int(HourY1);

    form1.Canvas.pen.Color:=clred;
    form1.Canvas.Pen.Width :=1;
    form1.Canvas.LineTo(strtoint(floattostr(x)),strtoint(floatto str(y))) ;
    form1.Canvas.LineTo(strtoint(floattostr(midx)),strtoint(floa ttostr(midy))) ;
    OldX := X ;
    OldY := Y ;
    if (Min_Update=true) then
    begin

    form1.Canvas.pen.Color:=clwhite;
    form1.Canvas.LineTo(strtoint(floattostr(OldXMin)),strtoint(f loattostr(OldYMin))) ;
    form1.Canvas.LineTo(strtoint(floattostr(MidX)),strtoint(floa ttostr(MidY))) ;
    Min_Update:=false;
    end;

    form1.Canvas.pen.Color:=clblack;
    form1.Canvas.LineTo(strtoint(floattostr(XMin)),strtoint(floa ttostr(YMin))) ;
    form1.Canvas.LineTo(strtoint(floattostr(MidX)),strtoint(floa ttostr(MidY))) ;

    if (Hour_Update=true) then
    begin
    form1.Canvas.Pen.Width :=3;
    form1.Canvas.pen.Color:=clwhite;
    form1.Canvas.LineTo(strtoint(floattostr(OldXHour)),strtoint( floattostr(OldYHour))) ;
    form1.Canvas.LineTo(strtoint(floattostr(MidX)),strtoint(floa ttostr(MidY))) ;
    Hour_Update:=false;
    end;
    form1.Canvas.Pen.Width :=3;
    form1.Canvas.pen.Color:=clblack;
    form1.Canvas.LineTo(strtoint(floattostr(XHour)),strtoint(flo attostr(YHour))) ;
    form1.Canvas.LineTo(strtoint(floattostr(MidX)),strtoint(floa ttostr(MidY))) ;

    end;

    procedure TForm1.FormShow(Sender: TObject);
    begin
    form1.Width :=200;
    form1.Height:=200;


    s := Form1.Width * 0.3;
    MidX := 50;
    MidY := 50;
    form1.Canvas.LineTo(strtoint(floattostr(midx)),strtoint(floa ttostr(midy))) ;
    oldx:=midx;
    oldy:=midy;
    form1.Canvas.Pen.Color :=clblack;
    form1.Canvas.Ellipse(0,0,100,100);
    form1.Canvas.Pen.Width :=8;
    end;
    //ekranda sadece akrep yelkoval ve saniye gözükecektir
    //saat ler için ayrı ayrı shape ekleyebilirsiniz
    //eğer her saat için bi shape eklemek isterseninz
    // formun wiev as tet kısmına bunları yazmanız gerekmektedir
    //tabi shapeleri ekledikden sonra
    object Shape2: TShape
    Left = 48
    Top = 0
    Width = 5
    Height = 5
    Brush.Color = clLime
    Shape = stCircle
    end
    object Shape3: TShape
    Left = 0
    Top = 48
    Width = 5
    Height = 5
    Brush.Color = clLime
    Shape = stCircle
    end
    object Shape4: TShape
    Left = 88
    Top = 48
    Width = 5
    Height = 5
    Brush.Color = clLime
    Shape = stCircle
    end
    object Shape5: TShape
    Left = 25
    Top = 4
    Width = 5
    Height = 5
    Brush.Color = clLime
    Shape = stCircle
    end
    object Shape6: TShape
    Left = 69
    Top = 85
    Width = 5
    Height = 5
    Brush.Color = clLime
    Shape = stCircle
    end
    object Shape7: TShape
    Left = 85
    Top = 70
    Width = 5
    Height = 5
    Brush.Color = clLime
    Shape = stCircle
    end
    object Shape8: TShape
    Left = 48
    Top = 88
    Width = 5
    Height = 5
    Brush.Color = clLime
    Shape = stCircle
    end
    object Shape9: TShape
    Left = 6
    Top = 70
    Width = 5
    Height = 5
    Brush.Color = clLime
    Shape = stCircle
    end
    object Shape10: TShape
    Left = 5
    Top = 24
    Width = 5
    Height = 5
    Brush.Color = clLime
    Shape = stCircle
    end
    object Shape11: TShape
    Left = 69
    Top = 4
    Width = 5
    Height = 5
    Brush.Color = clLime
    Shape = stCircle
    end
    object Shape12: TShape
    Left = 25
    Top = 85
    Width = 5
    Height = 5
    Brush.Color = clLime
    Shape = stCircle
    end
    object Shape13: TShape
    Left = 86
    Top = 24
    Width = 5
    Height = 5
    Brush.Color = clLime
    Shape = stCircle
    end
    object Shape14: TShape
    Left = 48
    Top = 48
    Width = 5
    Height = 5
    Brush.Color = clRed
    Shape = stCircle
    end



    Form açılışına şifre koymak


    Code:


    // Formun oncreate olayına...
    procedure TForm1.FormCreate(Sender: TObject);
    var
    x,b:string;
    begin
    b:='Buraya şifre giriniz';
    x:=inputbox('Programa Giriş','Programa girmek için şifreyi Giriniz:','');
    if x=b then
    application.messagebox('Programa Girişiniz Onaylandı.Tebrikler ..!','Tebrikler',mb_ok+mb_defbutton1)
    else
    halt;
    end;
    end.




    Ekram Görüntüsünü Almak


    Code:


    //Forma 1 'Image' koyun..

    var
    DCDesk: HDC;
    begin
    DCDesk:=GetWindowDC(GetDesktopWindow);
    BitBlt(Image1.Canvas.Handle, 0, 0, Screen.Width, Screen.Height,DCDesk, 0, 0,SRCCOPY);
    ReleaseDC(GetDesktopWindow, DCDesk);

    //GetDesktopWindow yerine görüntüsünü almak istediğiniz pencerenin handle'ını yazarsanız o pencerenin görüntüsü alınır.



    {ALINTIDIR}
  2. KısayolKısayol reportŞikayet pmÖzel Mesaj
    sorcerer
    sorcerer's avatar
    Üstün Hizmet Madalyası Üstün Hizmet Madalyası
    Kayıt Tarihi: 29/Ekim/2003
    Erkek

    bu ne ya .


    biraz tertipli olur :D


    insan açıklamayı yazar buraya sonra kodları bi hosta koyar link verir.


    Coco cola gibiyim hayatın tadıyım, rocco gibiyim çok şekerim, albeniyim bahanem çok, çikolatalı gofretim beni sevmeyen yok!...
  3. KısayolKısayol reportŞikayet pmÖzel Mesaj
    adanakebap
    Khaine
    Khaine's avatar
    Kayıt Tarihi: 16/Temmuz/2005
    Erkek
    vala ebnde anlıyabilmiş değilim enter tuşu ya bende işlemiyo yada sitede bir sorun var:D
Toplam Hit: 2254 Toplam Mesaj: 3