Hi Mark,
When are you attempting this??? I bascially do the same thing.
I subclasses the RTF control. Here is the code:
Notice that I created a few custom properties to hold the bound field - and a custom method that takes care of writing data back to the bound field.
HTH,
< JVP >
**************************************************
*-- Class: olertf (c:\winnt\profiles\john\personal\code\oleclasses.vcx)
*-- ParentClass: olecontrol
*-- BaseClass: olecontrol
*-- OLEObject = C:\WINNT\System32\richtx32.ocx
*
DEFINE CLASS olertf AS olecontrol
Height = 193
Width = 289
*-- This property holds the file name of the contained document.
cfilename = (Space(0))
Name = "olertf"
*-- If .T., various user notifcations will be displayed.
lnotify = .F.
*-- This property tracks when unsaved changes exist.
lchanged = .F.
*-- This property holds the field to which the RTF Control is bound
boundfield = .F.
errorcode = .F.
*-- This method will refresh the display based on contents in the boundfield
PROCEDURE refreshdisplayfromboundfield
This.TextRtf = Eval(This.BoundField)
Return
ENDPROC
*-- This method will update the contents of the memo with the RTFTEXT Property of the RTF Control.
PROCEDURE updateboundfield
Replace (This.BoundField) With This.TextRtf
Return
ENDPROC
PROCEDURE Error
LPARAMETERS nError, cMethod, nLine
Local Array aErrors[1]
Aerror(aErrors)
This.ErrorCode = aErrors[1,6]
Return
ENDPROC
PROCEDURE KeyPress
*** OLE Control Event ***
LPARAMETERS keyascii
This.lChanged = .T.
ENDPROC
*-- This method will print RTF document to printer.
PROCEDURE printdocument
ENDPROC
PROCEDURE errorhandler
ENDPROC
ENDDEFINE
*
*-- EndDefine: olertf
**************************************************
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only