Autor Beitrag
web
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 38



BeitragVerfasst: So 22.08.04 12:14 
Hallo zusammen,
hab mal eine Frage, ich wollte eine einzelne Zeile von einem TMemo Rot einfärben, ... geht das ? und wenn ja wie ?
Motzi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2931

XP Prof, Vista Business
D6, D2k5-D2k7 je Prof
BeitragVerfasst: So 22.08.04 12:38 
Nein, dazu benötigst du ein RichEdit..

_________________
gringo pussy cats - eef i see you i will pull your tail out by eets roots!
hansa
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 3079
Erhaltene Danke: 9



BeitragVerfasst: So 22.08.04 13:07 
Doch, ich behaupte : es geht. :mrgreen: Zumindest habe ich ein Memo, bei dem jede zweite Zeile anders gefärbt wird. Wenn ich mich nicht irre. :lol: Muß suchen, wo das ist.

_________________
Gruß
Hansa
web Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 38



BeitragVerfasst: So 22.08.04 13:12 
ja, gut und wie funktioniert das dann beim Richedit ?
hansa
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 3079
Erhaltene Danke: 9



BeitragVerfasst: So 22.08.04 13:20 
Habe mich doch vertan. :twisted: Es ist eine Listbox.

_________________
Gruß
Hansa
StefanH
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1144

Win XP
D5 Standard, D7 Pers, D2005 Pers
BeitragVerfasst: So 22.08.04 16:02 
web hat folgendes geschrieben:
ja, gut und wie funktioniert das dann beim Richedit ?


SelAttributes ist das Stichwort..

_________________
"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)
web Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 38



BeitragVerfasst: So 22.08.04 16:19 
Du verstehst schon was ich will oder, ... ich will das der hintergrund der zeile rot ist, nicht die schirft, ...
hansa
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 3079
Erhaltene Danke: 9



BeitragVerfasst: So 22.08.04 16:37 
Nun denn, es muß also ein Memo oder Richedit sein ? Tja, dann kann ich nicht helfen.

_________________
Gruß
Hansa
StefanH
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1144

Win XP
D5 Standard, D7 Pers, D2005 Pers
BeitragVerfasst: So 22.08.04 19:17 
web hat folgendes geschrieben:
Du verstehst schon was ich will oder, ... ich will das der hintergrund der zeile rot ist, nicht die schirft, ...


hats du aber nicht direkt gesagt... :P ka wie das geht...

_________________
"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)
hansa
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 3079
Erhaltene Danke: 9



BeitragVerfasst: So 22.08.04 20:37 
so geht es mit einer Listbox :

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
    if Index mod 2 = 0 then begin
      Listbox1.Canvas.Brush.Color := $00FFAB;
      Listbox1.Canvas.FillRect(Rect);
      Listbox1.Canvas.TextOut(Rect.Left, Rect.Top, Listbox1.Items[Index]);
    end
    else
      Listbox1.Canvas.TextOut(Rect.Left, Rect.Top, Listbox1.Items[Index]);

_________________
Gruß
Hansa
web Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 38



BeitragVerfasst: So 22.08.04 20:50 
ja und wie geht das jez bei richedit ???
oder wie gehts wenigstens das der text rot is ?
kann mir da jemand n beispiel geb ?
hintergrund der zeile rot wär aber bessa , wenn das net geht, ... dann is rote schrift auch ok, ... also, wär nett wenn mir jemand n code gebn könnt.
Keldorn
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 2266
Erhaltene Danke: 4

Vista
D6 Prof, D 2005 Pro, D2007 Pro, DelphiXE2 Pro
BeitragVerfasst: So 22.08.04 20:56 
Zitat:

oder wie gehts wenigstens das der text rot is ?

Hat dir stefanH schon gesagt

StefanH hat folgendes geschrieben:
web hat folgendes geschrieben:
ja, gut und wie funktioniert das dann beim Richedit ?


SelAttributes ist das Stichwort..


da ist sogar ein Bsp in der Hilfe, da wird sogar der text rot gemacht ....
Den Hintergrund für gewisse zeilen anders zu machen: ich wüßte nicht, wie das geht. Aber du kannst das nichtmal im Word dirket machen, glaube also nicht, das das geht.

Mfg Frank

_________________
Lükes Grundlage der Programmierung: Es wird nicht funktionieren.
(Murphy)
majolo
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 334

Ubuntu 8.04, WinXP Prof.
D1, D6Pers, D7 Prof., D8 Prof., D2005 Pers
BeitragVerfasst: So 22.08.04 21:04 
web hat folgendes geschrieben:
ja und wie geht das jez bei richedit ???
oder wie gehts wenigstens das der text rot is ?


ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
procedure TForm1.Button1Click(Sender: TObject);
begin
 RichEdit1.SelStart:=0;
 RichEDit1.SelLength:=6;
 RichEdit1.SelAttributes.Color:=clred;
end;


Für den Hintergrund schau mal hier www.swissdelphicente...showcode.php?id=1438

Dafür braucht man aber Richedit Version 2.0, glaube ich.

_________________
Gruß
majolo
web Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 38



BeitragVerfasst: So 22.08.04 21:18 
Also das mit dem Hintergrund funzt, ... danke, .. aber wie mach ich das automatisch n Text makiert wird ? Also das er jez die gnaze zeile markiert, net das ich das machn muss.
Tino
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Veteran
Beiträge: 9839
Erhaltene Danke: 45

Windows 8.1
Delphi XE4
BeitragVerfasst: Mo 23.08.04 09:43 
web hat folgendes geschrieben:
Also das mit dem Hintergrund funzt, ... danke, ..

Schön! :-)

web hat folgendes geschrieben:
aber wie mach ich das automatisch n Text makiert wird ?

Neue Frage = Neues Topic.

Gruß
Tino