Solved

Set more colors in one line in RichEdit

Posted on 2001-06-30
6
209 Views
Last Modified: 2013-11-22
I am using RichEdit's SelAtribute funtion to change font colors. Can anyone tell me how to set more than one color in a single line?
ysimon
0
Comment
Question by:ysimon
  • 4
6 Comments
 
LVL 27

Expert Comment

by:kretzschmar
ID: 6242051
? whats the problem

may have this line in richedit

This is a line

use a code like

richedit1.selstart := 0;
richedit1.sellength := 4;
richedit1.selattributes.color := clred;
richedit1.selstart := 10;
richedit1.sellength := 4;
richedit1.selattributes.color := clblue;

now you will have 'This' in red and 'line' in blue the rest remains in the default color usual black

(that was just from head, syntax errors possible)

meikl ;-)
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 6242063
as working sample (tested)

procedure TForm1.Button1Click(Sender: TObject);
begin
  richedit1.lines.clear;
  richedit1.lines.add('This is a line');
  richedit1.selstart := 0;
  richedit1.sellength := 4;
  richedit1.selattributes.color := clred;
  richedit1.selstart := 10;
  richedit1.sellength := 4;
  richedit1.selattributes.color := clblue;
  richedit1.SelStart := 0;
  richedit1.Sellength := 0;
end;

meikl ;-)
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 6247433
hello? anyone here?
0
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 
LVL 1

Expert Comment

by:drnadeem
ID: 6247653
listening
0
 

Author Comment

by:ysimon
ID: 6249469
Thank you kretzschmar,
It works.
ysimon
0
 
LVL 27

Accepted Solution

by:
kretzschmar earned 50 total points
ID: 6251396
well, then may i lock this q ;-)

don't forget the grading

glad to helped you
good luck again

meikl ;-)
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now