Page 1 of 1

Removing formatting with DBSRichViewEdit1

Posted: Wed Jan 25, 2012 12:17 pm
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

Posted: Thu Jan 26, 2012 7:59 pm
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);

Posted: Fri Jan 27, 2012 10:22 am
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?

Posted: Sat Jan 28, 2012 11:37 am
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

Posted: Sun Jan 29, 2012 10:16 pm
by alexandreq
thanks very much.

It worked fine