?
Solved

Set more colors in one line in RichEdit

Posted on 2001-06-30
6
Medium Priority
?
229 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Suggested Courses

719 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