Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Set more colors in one line in RichEdit

Posted on 2001-06-30
6
Medium Priority
?
235 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
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 200 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

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Suggested Courses

885 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