Einzelnen Beitrag anzeigen

Benutzerbild von baumina
baumina

Registriert seit: 5. Mai 2008
Ort: Oberschwaben
1.275 Beiträge
 
Delphi 11 Alexandria
 
#6

AW: Lauftext von rechts nach links

  Alt 18. Nov 2013, 14:13
Hier ein kleines Beispiel:

Delphi-Quellcode:
type
  TForm62 = class(TForm)
    Timer1: TTimer;
    procedure Timer1Timer(Sender: TObject);
  private
    { Private-Deklarationen }
  public
    { Public-Deklarationen }
  end;

var
  Form62: TForm62;
  i : Integer;

const
  aText = 'Dies ist ein Text';

implementation

{$R *.dfm}

procedure TForm62.Timer1Timer(Sender: TObject);
begin
  inc(i);
  if i > length(aText) then
  begin
    Timer1.Enabled := False;
    Exit;
  end;
  canvas.textout(50+i*10,50,aText[i]);
end;
Delphi-Quellcode:
object Form62: TForm62
  Left = 0
  Top = 0
  Caption = 'Form62'
  ClientHeight = 337
  ClientWidth = 635
  Color = clBtnFace
  Font.Charset = DEFAULT_CHARSET
  Font.Color = clWindowText
  Font.Height = -11
  Font.Name = 'Tahoma'
  Font.Style = []
  OldCreateOrder = False
  PixelsPerInch = 96
  TextHeight = 13
  object Timer1: TTimer
    Interval = 1000
    OnTimer = Timer1Timer
    Left = 518
    Top = 180
  end
end
Hinter dir gehts abwärts und vor dir steil bergauf ! (Wolfgang Ambros)
  Mit Zitat antworten Zitat