Manuel Lopez-Michelone
asked on
RichEdit font problem
Hi guys,
This is my problem... I have few procedures to change the font in a richedit component
procedure WriteA(s : string);
begin
Form1.RichEdit1.Font.Name := 'Chess Merida';
Form1.RichEdit1.Font.Size := 20;
Form1.RichEdit1.Lines.Add( s);
end;
procedure WriteB(s: string);
begin
Form1.RichEdit1.Font.Name := 'Courier New';
Form1.RichEdit1.Font.Size := 10;
Form1.RichEdit1.Lines.Add( s);
end;
and I use both procedures alternate over a richedit... i.e.
WriteA('Hello');
WriteB('GoodBye');
but... when I finish writing over the richtext, the font assigned to each string is not respected. I mean, everything appears with the same font... Am I missing something?
best regards,
Manuel Lopez (lopem)
This is my problem... I have few procedures to change the font in a richedit component
procedure WriteA(s : string);
begin
Form1.RichEdit1.Font.Name := 'Chess Merida';
Form1.RichEdit1.Font.Size := 20;
Form1.RichEdit1.Lines.Add(
end;
procedure WriteB(s: string);
begin
Form1.RichEdit1.Font.Name := 'Courier New';
Form1.RichEdit1.Font.Size := 10;
Form1.RichEdit1.Lines.Add(
end;
and I use both procedures alternate over a richedit... i.e.
WriteA('Hello');
WriteB('GoodBye');
but... when I finish writing over the richtext, the font assigned to each string is not respected. I mean, everything appears with the same font... Am I missing something?
best regards,
Manuel Lopez (lopem)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
yep that'll work fine :)
also just note to say the example was from using trichedit98 (from torrys)
using trichedit98 you can change the background color of each line using selattributes.backcolor which normal richedit dont have.
also just note to say the example was from using trichedit98 (from torrys)
using trichedit98 you can change the background color of each line using selattributes.backcolor which normal richedit dont have.
ASKER
Thanks for the fast response... I just changed:
procedure WriteA(s : string);
begin
Form1.RichEdit1.SelAttribu
Form1.RichEdit1.SelAttribu
Form1.RichEdit1.Lines.Add(
end;
procedure WriteB(s: string);
begin
Form1.RichEdit1.SelAttribu
Form1.RichEdit1.SelAttribu
Form1.RichEdit1.Lines.Add(
end;
And everything worked now! Thanks a lot!
best regards,
Manuel Lopez (lopem)