property Text

[Top]  [Chapter]  [Previous]  [Next]

This property is used to bind the control to a database. The format used can be changed using the property TextFormat. You can specify RTF, WPTOOLS, HTML or ANSI. The data used to store the formatted text is plain ASCII code with the binary data of embedded images. To avoid binary data you can use a format string such as "RTF-nobinary", but that will work less efficient since the string becomes larger and loading and saving takes longer.


The property Text2 is used to save and load the data from the second editor - if a second editor is contained inside the control.


The datatype of property Text and Text2 is VARIANT - you can assign a usual unicode string and a variant byte array. When reading this propetry always(*) a variant byte array will be created. To get a standard string from the editor use the method GetText. To get a variant array of bytes you can use GetTextVar. To load/insert from a string or a variant array use SetTextVar. (The method SetText is similar but will only accept strings)


When binding the editor to a database use a binary field to hold the data. The field should be an image field in SQL server, or  an oleobject field in MS Access.


*) If you append "-useolestring," to the property TextFormat, a standard double byte OLE string instead of the variant array of byte will be created.

[propertytext.htm]    Copyright © 2007 by WPCubed GmbH