Hello Sergey,
How could I get all words from my DBSRichViewEdit that is in red color font?
For example:
Each word found in clred font, I will add in a stringList.
It would be very interesting to have this for background color too, that is, each word in background color in clred should add in a StringList.
thanks
Alex
How to get all words with a determined color from my text ?
-
- Posts: 184
- Joined: Wed Jan 18, 2012 6:22 pm
-
- Site Admin
- Posts: 17559
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
I can explain how to get all red text. You can separate it into words yourself.
Code: Select all
procedure GetRedText(RVData: TCustomRVData);
var i,r,c, StyleNo: Integer;
table: TRVTableItemInfo;
begin
for i := 0 to RVData.ItemCount-1 do begin
StyleNo := RVData.GetItemStyle(i);
if (StyleNo>=0) and (RVData.GetRVStyle.TextStyles[StyleNo].Color=clRed) then
// add RVData.GetItemText(i) to string list
else if StyleNo=rvsTable then begin
table := TRVTableItemInfo(RVData.GetItem(i));
for r := 0 to table.RowCount-1 do
for c := 0 to table.ColCount-1 do
if table.Cells[r,c]<>nil then
GetRedText(table.Cells[r,c].GetRVData);
end;
end;
end;
-
- Posts: 184
- Joined: Wed Jan 18, 2012 6:22 pm