How to save background in my field?

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

How to save background in my field?

Post 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
alexandreq
Posts: 184
Joined: Wed Jan 18, 2012 6:22 pm

Post by alexandreq »

I forgot to comment:

Both RVFOptions.rvfoSaveBack and RVFOptions.rvfoLoadBack are true
Sergey Tkachenko
Site Admin
Posts: 17557
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post 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)
Post Reply