trichview.support
Re: How can i force TDBRichViewEdit to apply changes in field programmatically? |
Author |
Message |
Sergey Tkachenko |
Posted: 12/03/2002 18:51:32 This example shows how to use viewer-style methods in DBRichViewEdit (i.e. methods, introduced in TCustomRichView) DBRichViewEdit1 edits a field of table Table1.We want to load RTF file. procedure TForm1.Button1Click(Sender: TObject); begin if OpenDialog1.Execute then begin Table1.Edit; DBRichViewEdit1.Clear; DBRichViewEdit1.LoadRTF(OpenDialog1.FileName); DBRichViewEdit1.Change; DBRichViewEdit1.Format; end; end; If you want to save changed in the database immediately, call Table1.Post instead of DBRichViewEdit1.Format. This sequence of actions (Edit - modifications - Change - Format) is required only for viewer-style methods. Methods introduced in TCustomRichViewEdit do this work automatically: procedure TForm1.Button2Click(Sender: TObject); begin if OpenDialog1.Execute then DBRichViewEdit1.InsertRTFFromFileEd(OpenDialog1.FileName); end; |
Powered by ABC Amber Outlook Express Converter