Autor Beitrag
StefanH
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1144

Win XP
D5 Standard, D7 Pers, D2005 Pers
BeitragVerfasst: Fr 25.07.03 13:46 
Hallo zusammen!

Also ich hab da einige Labels, und die möchte ich mit Inhalt füllen, so in einer Schreibmaschine, also dass die Buchstaben einzeln mit Abstand reinkommen und zwar beim öffnen der Form.

Ich habs schon probiert aber, naja :oops:

Stefan

_________________
"Als es noch keine Computer gab, war das Programmieren noch relativ einfach."(Edsger W. Dijkstra)
"Ich bin nicht von Sinnen, sondern ich rede wahre und vernünftige Worte." (Paulus)
kat1
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 40

Win XP
D6 EntPr
BeitragVerfasst: Fr 25.07.03 13:58 
Auch wenn Dein erster Versuch nicht funktioniert, könnte der Quelltext für uns doch von Wichtigkeit sein, um Dein Problem komplett zu verstehen. Wie wäre es denn, wenn Du im OnCreate-Ereignis die Label-Captions folgendermaßen füllst:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
Label1.Caption:='H'; //Erstes Zeichen
Pause(100);
Label1.Caption:=Label1.Caption+' A'; //Zweites Zeichen mit einem Leerzeichen
.
.
.
//usw.


Falls ich Dich jetzt falsch verstanden habe, tut es mir leid.
Achso Code ist nur ein Vorschlag, keine Garantie.

_________________
Mfg Uwe
Es ist eine Unsitte der Menschen, sich an alles zu gewöhnen.
StefanH Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1144

Win XP
D5 Standard, D7 Pers, D2005 Pers
BeitragVerfasst: Fr 25.07.03 14:07 
kat1 hat folgendes geschrieben:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
Label1.Caption:='H'; //Erstes Zeichen
Pause(100);
Label1.Caption:=Label1.Caption+' A'; //Zweites Zeichen mit einem Leerzeichen
.
.
.
//usw.


So hate ichs ja, bloß mit sleep anstatt Pause (gibts net), die Form ist grau und wenn das Label voll ist, dann ist die Form da :(

Stefan

_________________
"Als es noch keine Computer gab, war das Programmieren noch relativ einfach."(Edsger W. Dijkstra)
"Ich bin nicht von Sinnen, sondern ich rede wahre und vernünftige Worte." (Paulus)
gogi2207
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 45



BeitragVerfasst: Fr 25.07.03 15:05 
dann schieb mal noch ein Label1.refresh ein bevor du die neue caption zuweist.

Gogi
kat1
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 40

Win XP
D6 EntPr
BeitragVerfasst: Fr 25.07.03 15:46 
Ja stimmt, die pause Funktion gab es nur in Turbo Pascal, hatte mir selbst so eine Funktion geschrieben, weil ich sleep irgendwie nich gefunden hatte.

Probier's doch mal mit einer Abfrage, die am Ende von FormCreate eine Bool-Variable auf True setzt und mit der dann eine andere Routine gestartet wird, die Deine Label's füllt.

_________________
Mfg Uwe
Es ist eine Unsitte der Menschen, sich an alles zu gewöhnen.
Cruiser23
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 191

WinXP
D7 Prof.
BeitragVerfasst: Fr 25.07.03 20:04 
Vieleicht hilft dir das weiter:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
procedure TFormLauf.ButtonLaufClick(Sender: TObject);
begin
   LabelLauf.Caption := EditEingabe.Text;
end;

procedure TFormLauf.TimerLaufTimer(Sender: TObject);
VAR Text : STRING;
begin
   Text := Copy (LabelLauf.Caption,2,length(LabelLauf.Caption)-1)+
                LabelLauf.Caption[1];
   LabelLauf.Caption := Text;
end;

procedure TFormLauf.FormCreate(Sender: TObject);
begin
   ButtonLaufClick(Sender);
end;

_________________
Du steckst immer in der Sch****, das einzige, was sich ändert, ist die Tiefe!
Guardian of R'lyeh
Hält's aus hier
Beiträge: 14

Windows9x, WindowsXP
D7 Prof
BeitragVerfasst: Sa 26.07.03 14:02 
jepp, mit nem Timer hätte ich es auch gemacht
StefanH Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1144

Win XP
D5 Standard, D7 Pers, D2005 Pers
BeitragVerfasst: Sa 26.07.03 18:10 
Kein Bildlauf! Ein Schreibmaschinen Effekt!

So ungefähr:

S
St
Ste
Stef
Stefa
Stefan

Kapiert? :wink:

_________________
"Als es noch keine Computer gab, war das Programmieren noch relativ einfach."(Edsger W. Dijkstra)
"Ich bin nicht von Sinnen, sondern ich rede wahre und vernünftige Worte." (Paulus)
Guardian of R'lyeh
Hält's aus hier
Beiträge: 14

Windows9x, WindowsXP
D7 Prof
BeitragVerfasst: Sa 26.07.03 18:21 
Ich hab in 5 Minuten eben folgendes zusammengeschustert:

ausblenden volle Höhe Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
unit Unit1;

interface

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

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

var
  Form1: TForm1;
  ZeichenPos : integer;
  Text : string;

implementation

{$R *.dfm}

procedure TForm1.FormCreate(Sender: TObject);
begin
   Text := 'Stefan';
   label1.Caption := '';
   ZeichenPos := 1;
   Timer1.Enabled := TRUE;
end;

procedure TForm1.Timer1Timer(Sender: TObject);
begin
   Label1.Caption := Label1.Caption + Text[ZeichenPos];
   if not (ZeichenPos >= length(Text)) then Inc(ZeichenPos)
   else Timer1.Enabled := FALSE;
end;

end.


vielleicht hilft es als Beispiel ;)

Moderiert von user profile iconUGrohne: Code- durch Delphi-Tags ersetzt
StefanH Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1144

Win XP
D5 Standard, D7 Pers, D2005 Pers
BeitragVerfasst: Do 31.07.03 13:35 
Ja, das geht.

Aber wenn ich jetzt mehrere Labels hab, und die dann nacheinander füllen will mit Pause dazwischen? Einfach ein Label nehmen, und dann per #1013 Absätze einfügen?

_________________
"Als es noch keine Computer gab, war das Programmieren noch relativ einfach."(Edsger W. Dijkstra)
"Ich bin nicht von Sinnen, sondern ich rede wahre und vernünftige Worte." (Paulus)