<< Click to Display Table of Contents >> FormFieldControl |
Inserts either an Interactive FormField or an Interactive Text control into the document. The value of the property CharCount decides, which type of control is inserted:
If CharCount is > 1: |
an Interactive FormField control is inserted, and CharCount determines the number of character cells. |
If CharCount is = 0: |
an Interactive Text control is inserted, and an unlimited number of characters (until the visible portion of the control is filled-up) may be entered by the user into the control. |
If CharCount is < 0: |
an Interactive Text control is inserted, and CharCount determines the maximum number of characters which may be entered by the user into the control. |
In case an Interactive FormField control is inserted, the same rules apply as described for the FormField.
In case an Interactive Text control is inserted, the control is editable over multiple lines, instead of a single line as with the Interactive FormField control. The control can be filled up with as many characters as will fit into the given rectangle of the object. In addition, the text alignment of Interactive Text control may be chosen freely (left, right, centered, justified).
method TVPEObject VPE.FormFieldControl(
VpeCoord Left,
VpeCoord Top,
VpeCoord Right,
VpeCoord Bottom,
string Text
)
VpeCoord Left, Top, Right, Bottom
position and dimensions
string Text
the editable text displayed in the control (the control works with an internal copy of this text, it does not write to the memory pointed at by text)
Returns:
The VPE Object which represents the control. This VPE Object can be used later in your code to, for example, set the input focus on it or to retrieve its value and to change some of its properties.
Remarks:
VPE offers several methods to attach an object's position to margins and relative to the position of previously inserted objects. In addition Text, Rich Text and Picture objects are able to compute their dimensions automatically depending on their visual content.
For details please see "Dynamic Positioning" in the Programmer's Manual.
If you are using a multi-line Interactive Text control, lines are separated with the characters #13 + #10. (ASCII Code 13 plus ASCII Code 10)
Example:
// Insert an Interactive Text Control, where an unlimited number of
// characters may be entered:
Dim Control1 as TVPEObject
Dim Control2 as TVPEObject
Dim Control3 as TVPEObject
Doc.CharCount = 0
Control1 = Doc.FormFieldControl(1, 1, -9, VFREE, "Hello" + #10 + #13 + "World!")
// Insert an Interactive Text Control, limited to max. 14 characters:
Doc.CharCount = -14
Control2 = Doc.FormFieldControl(1, 2, -9, VFREE, "Hello" + #10 + #13 + "World!")
// Insert an Interactive Form Field Control, limited to max. 14 characters:
Doc.CharCount = 14
Control3 = Doc.FormFieldControl(1, 3, -9, VFREE, "Hello World!")
.NET:
use Doc.nFree instead of VFREE in the example above
"Interactive Documents" in the Programmer's Manual.