Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

TRichEdit - How do I change the font colour of words typed in by user? 1

Status
Not open for further replies.

LucieLastic

Programmer
May 9, 2001
1,694
GB
I've tried everything for this one and looked everywhere but can't find anything.

I load a file's contents in to a TRichEdit and it jumps to the position for the user. When the user types or pastes something new in to the Rich Edit, I want it to appear in a different font colour so it shows them whats changed.

Any ideas if this is possible? I don't really want to install any new components to do this as it's not essential but more of a useful thing to have.

If anyone can steer me in the right direction, I'd be grateful.

Many thanks in advance
Lou

www.radbmx.co.uk
 
place this code in the Richedit's Onkeydown event

Code:
 RichEdit1.SelAttributes.Color := clRed;

Cheers,
Daddy

-----------------------------------------------------
What You See Is What You Get
Never underestimate tha powah of tha google!
 
Fantastic! I tried that in the onChange event, didn't think of the OnKeyDown event (doh!).

All I need to do now, is stop the font colour being changed when they copy an existing line. Normally they copy an existing line and then paste it in and edit it with the new values. I think I can do this bit, will let you know if I get stuck again.

Thanks fella
Lou

www.radbmx.co.uk
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top