Page 1 of 1

How to save background in my field?

Posted: Wed Feb 08, 2012 7:00 pm
by alexandreq
Hello,

I selected an image for background and I inserted into my TDBSRichViewEdit.

The image is inserted and displayed ok, but my editor doesn't save into my table.

this is my code:

With Editor.RichViewEdit do begin
Table.Edit;
BackgroundBitmap := FTMNBackGroundIMG.rv.BackgroundBitmap;
BackgroundStyle := FTMNBackGroundIMG.rv.BackgroundStyle;
color := FTMNBackGroundIMG.rv.Color;
Table.Post
end;


Thanks

Posted: Thu Feb 09, 2012 5:59 pm
by alexandreq
I forgot to comment:

Both RVFOptions.rvfoSaveBack and RVFOptions.rvfoLoadBack are true

Posted: Thu Feb 09, 2012 7:59 pm
by Sergey Tkachenko
Assigning values to the background properties is not an editing operation, so you need to follow the code pattern from http://www.trichview.com/help/idh_examp ... edit1.html :

Code: Select all

if Editor.RichViewEdit.CanChange then
  With Editor.RichViewEdit do begin 
    BackgroundBitmap := FTMNBackGroundIMG.rv.BackgroundBitmap; 
    BackgroundStyle := FTMNBackGroundIMG.rv.BackgroundStyle; 
    color := FTMNBackGroundIMG.rv.Color; 
    Change;
    Table.Post 
end; 
(Editor.RichViewEdit.CanChange may be replaced to Table.Edit, but you forgot to call Editor.RichViewEdit.Change)