Autor Beitrag
Fabian W.
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1766

Win 7
D7 PE
BeitragVerfasst: Do 05.05.05 10:49 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
 procedure TForm1.AddRunSys(Ausgabe: String; Farbe: TColor; Art: TFontStyles);
begin
Form6.RichEdit1.SelAttributes.Color := Farbe;
Form6.RichEdit1.SelAttributes.Style := Art;
Form6.RichEdit1.Lines.Add(datetostr(date)+', '+timetostr(time)+' : '+Ausgabe);
end;


Kann mir jemand sagen was ich hier falsch mache??

Ich ruf die Procedure so auf:

ausblenden Delphi-Quelltext
1:
 AddRunSys('Hallo',clred,[fsbold]);					


Manchmal is die Zeile rot und nicht fett manchmal sit sie nicht rot aber fett, manchmal is sie auch beides. Fehlermeldungen oder Hinweise und Warnungen kommen nicht.
Hansi@OMG
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 304

Vista
Delphi 2006 Prof., Lazarus
BeitragVerfasst: Do 05.05.05 11:13 
Ich glaub du musst das so schreiben:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
 procedure TForm1.AddRunSys(Ausgabe: String; Farbe: TColor; Art: TFontStyles);
begin
Form6.RichEdit1.SelAttributes.Color := Farbe;
Form6.RichEdit1.SelAttributes.Style := [Art];
Form6.RichEdit1.Lines.Add(datetostr(date)+', '+timetostr(time)+' : '+Ausgabe);
end;

_________________
Who doesn't know the Micrsoft developer "Mahatma Fatal Error"?
Hansi@OMG
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 304

Vista
Delphi 2006 Prof., Lazarus
BeitragVerfasst: Do 05.05.05 11:17 
Ah ok, verstehe, die eigenschaft selattributes bezieht sich auf den markierten Text. Wenn der Text nicht markiert ist, wir die Zeile gesetzt. Du musst, bevor nachdem du die rote fette Zeile eingefügt hast, die Attribute wieder zurücksetzen.

_________________
Who doesn't know the Micrsoft developer "Mahatma Fatal Error"?
Fabian W. Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1766

Win 7
D7 PE
BeitragVerfasst: Fr 06.05.05 14:35 
Was meinst du mit zurücksetzen. Vor jeder Zeile wird der Sch*** doch neu 'deklariert'.