Solved

Formating text style in DBRichEdit

Posted on 1998-03-08
1
604 Views
Last Modified: 2013-11-22
My application has a DBRichEdit control. How do I select individual words that I want to highlight in bold or italics (ie change the word/s I have selected with the mouse to a different font.style).

Thanks
JE
0
Comment
Question by:JohnE
1 Comment
 

Accepted Solution

by:
wtamviset earned 100 total points
ID: 1360270
To select words in RichEdit or DBRichEdit . You can use  SelStart and SelLength properties.
For Example :  
 DBRichEdit.SelStart := 10;
 DBRichEdit.SelLength := 5;
If you want to know what text that display in RichEdit window. You can you  Lines,Text properties.
Example to highlight  Hello word in DBRichEdit.
 I := Pos('Hello',DBRichEdit1.Text);
 If I > 0 then
Begin
    DBRichEdit1.SelStart := I;
    DBRichEdit1.SelLength := Length('Hello');
    DBRichEdit1.SelAttributes.Style := [fsBold];
End;

0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

746 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

9 Experts available now in Live!

Get 1:1 Help Now