Header Ads

test
TEXT BERJALAN


  •    Buatlah file pada form1 Delphi 7 seperti diatas
  •     Tamabahkan timer1 dan timer2 pada button system Delphi 07
  •   Timer1 berfungsi sebagai penggerak teks dan timer2 untuk  waktu.



  •              Pada timer 1 masukkan data di Unit1 seperti tampilan diatas.


unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, ExtCtrls, ComCtrls, StdCtrls;

type
  TForm1 = class(TForm)
    StatusBar1: TStatusBar;
    Timer1: TTimer;
    Timer2: TTimer;
    Label1: TLabel;
    procedure Timer1Timer(Sender: TObject);
    procedure Timer2Timer(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;
  n:integer ;
  Tulisan :string = 'vion age tricahyo';

implementation

{$R *.dfm}

procedure TForm1.Timer1Timer(Sender: TObject);
begin
statusbar1.Panels[1].Text:=datetimetostr(now);
end;

procedure TForm1.Timer2Timer(Sender: TObject);
begin
  n:= n+1;
  if n>length (tulisan) then n:=1;
  Label1.Caption := Copy (tulisan,1,n);

end;

end.

  •         Untuk timer2 sebagai waktu




unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, ExtCtrls, ComCtrls, StdCtrls;

type
  TForm1 = class(TForm)
    StatusBar1: TStatusBar;
    Timer1: TTimer;
    Timer2: TTimer;
    Label1: TLabel;
    procedure Timer1Timer(Sender: TObject);
    procedure Timer2Timer(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;
  n:integer ;
  Tulisan :string = 'vion age tricahyo';

implementation

{$R *.dfm}

procedure TForm1.Timer1Timer(Sender: TObject);
begin
statusbar1.Panels[1].Text:=datetimetostr(now);
end;

procedure TForm1.Timer2Timer(Sender: TObject);
begin
  n:= n+1;
  if n>length (tulisan) then n:=1;
  Label1.Caption := Copy (tulisan,1,n);

end;

end.

  •         Tampilan akhir sebagai berikut dengan tulisan berjalan.





Tidak ada komentar:

Diberdayakan oleh Blogger.