BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Richedit - how to ignore font color at random insert positio

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi VCL Components Using
View previous topic :: View next topic  
Author Message
Ralf
Guest





PostPosted: Tue Nov 25, 2003 4:35 pm    Post subject: Richedit - how to ignore font color at random insert positio Reply with quote



I want to display a text with various colors in a RichEdit control, but make
sure that the user can only insert black text. By default, RichEdit takes
the attributes at the current cursor position. How can I prevent that? I
want absolut control over the inserted text.

Thanks for any ideas!


Back to top
Peter Below (TeamB)
Guest





PostPosted: Tue Nov 25, 2003 6:46 pm    Post subject: Re: Richedit - how to ignore font color at random insert pos Reply with quote



In article <3fc384d0 (AT) newsgroups (DOT) borland.com>, Ralf wrote:
Quote:
I want to display a text with various colors in a RichEdit control, but make
sure that the user can only insert black text. By default, RichEdit takes
the attributes at the current cursor position. How can I prevent that? I
want absolut control over the inserted text.

In the controls OnKeyPress event do a

(sender as trichedit).SelAttributes.Color := clBlack;

--
Peter Below (TeamB)
Use the newsgroup archives :
http://www.mers.com/searchsite.html
http://www.tamaracka.com/search.htm
http://groups.google.com
http://www.prolix.be



Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi VCL Components Using All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.