Remove all highlighting from DBRichView...

General TRichView support forum. Please post your questions here
Post Reply
agent86
Posts: 59
Joined: Mon Jun 28, 2010 2:18 am
Location: San Francisco Bay Area, USA
Contact:

Remove all highlighting from DBRichView...

Post by agent86 »

Sometimes the user is going to hightlight certain portions of the text and after it is reviewed they will want to remove it. Is there a command that removes all highlighting? i want it to leave all other formatting.

Thanks...
Sergey Tkachenko
Site Admin
Posts: 17559
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

1)Do you want to change all text background color to transparent?
2) If yes, do you want to apply it to the selection (as an editing operation) or to the whole document (without possible undo)?
3) Do you use RichViewActions?
agent86
Posts: 59
Joined: Mon Jun 28, 2010 2:18 am
Location: San Francisco Bay Area, USA
Contact:

Remove all highlighting from DBRichView...

Post by agent86 »

I used the Editor 2 demo as the basis of the project. I used a DBRichViewEdit instead of a RichViewEdit.

Program Files/RichView/rvhelp/TRichView/Demos/Delphi/Editors/Editor 2

I want to click a speed button and all highlighting on the DBRichEdit document will go away or disappear.

Transparent, I guess so. Whatever happens when you manually highlight and make highlighting go away.

I want the entire document to have highlighting removed. I don't want to have to select the entire document if it is not necessary.

During the document creation the users highlight many portions of the document but want it all removed before printing or archived.
Sergey Tkachenko
Site Admin
Posts: 17559
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

The simplest way to do it:

Code: Select all

// for text
for i := 0 to rvs.TextStyles.Count-1 do
  rvs.TextStyles[i].BackColor := clNone;
// for paragraph
for i := 0 to rvs.ParaStyles.Count-1 do
  rvs.ParaStyles[i].Background.Color := clNone;
rve.Repaint;
agent86
Posts: 59
Joined: Mon Jun 28, 2010 2:18 am
Location: San Francisco Bay Area, USA
Contact:

Thanks...

Post by agent86 »

Works great...
Post Reply