Removing formatting with DBSRichViewEdit1

General TRichView support forum. Please post your questions here
Post Reply
alexandreq
Posts: 184
Joined: Wed Jan 18, 2012 6:22 pm

Removing formatting with DBSRichViewEdit1

Post by alexandreq »

Hello Friend,

I am using your function to remove all formatting.

When I did it, I notice that it was done only on the screen.

How to save this changed in table with the text?

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

Post by Sergey Tkachenko »

See http://www.trichview.com/help/idh_examp ... edit1.html
Insert your code for clearing text format instead of

Code: Select all

DBRichViewEdit1.Clear;
DBRichViewEdit1.LoadRTF(OpenDialog1.FileName);
alexandreq
Posts: 184
Joined: Wed Jan 18, 2012 6:22 pm

Post by alexandreq »

Sergey

But my text comes from my table and not from a file.

I used your function and all my text was clear. But the problem is that my table didn't be in state of dsEdit after cleaning all the formating of the text.

did you understand?
Sergey Tkachenko
Site Admin
Posts: 17559
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Use this code:

Code: Select all

if DBRichViewEdit1.CanChange then begin
    <your code for clearing formatting here>
    DBRichViewEdit1.Change;
    DBRichViewEdit1.Format;
end;
Or, if you want to save changes immediately:

Code: Select all

if DBRichViewEdit1.CanChange then begin
    <your code for clearing formatting here>
    DBRichViewEdit1.Change;
    Table1.Post;
end;
DBRichViewEdit1.CanChange activates table editing, it makes table state = dsEdit
alexandreq
Posts: 184
Joined: Wed Jan 18, 2012 6:22 pm

Post by alexandreq »

thanks very much.

It worked fine
Post Reply