Use the RichText Control Sample
Visual FoxPro 9.0 SP2 |
Use the RichText Control Sample |
See Also |
File: ...\Samples\Solution\OLE\Rtf.scx
This sample illustrates using a RichText control to display and edit RTF text stored in the memo field of a table.
You can set the ControlSource of a RichText control directly to a character field, but not a memo field. Instead, create a form property to mediate between the RichText control and the memo field.
To store RTF text in a memo field
-
Set the ControlSource property of the RichText control to the form property.
Copy Code
THISFORM.oleRTF.ControlSource = THISFORM.cText
-
Store the memo field contents to the form property.
Copy Code
THISFORM.cText = rtf.source
-
Before moving the record pointer, store the TextRTF property of the RichText control to the memo field.
Copy Code
REPLACE rtf.Source WITH THISFORM.oleRTF.TextRTF
The text stored in the memo file is standard RTF format, for example:
{\rtf1\ansi\deff0\deftab720{\fonttbl{\f0\fswiss MS Sans Serif;}{\f1\froman\fcharset2 Symbol;}{\f2\fswiss Arial;}{\f3\fswiss Arial;}} {\colortbl\red0\green0\blue0;\red255\green0\blue0;} \deflang1033\pard\qc\plain\f3\fs32\i The RichTextBox Control \par \pard\plain\f3\fs20
See Also
Tasks
Solution SamplesReference
Visual FoxPro Foundation Classes A-ZOther Resources
ActiveX Solution Samples© , 1996-2020 • Updated: 11/10/20
Comment or report problem with topic