VpeFormFieldControl

<< Click to Display Table of Contents >>

Navigation:  Interactive Objects >

VpeFormFieldControl

Previous pageReturn to chapter overviewNext page

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).

VpeHandle VpeFormFieldControl(

VpeHandle hDoc,

VpeCoord x,

VpeCoord y,

VpeCoord x2,

VpeCoord y2,

LPCSTR s

)

VpeHandle hDoc

Document Handle

VpeCoord x, y, x2, y2

position and dimensions

LPCSTR 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 handle of the control. This handle can be used later in your code to identify the object (for example, to 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 "\r\n". (ASCII Code 13 plus ASCII Code 10)

Example:

// Insert an Interactive Text Control, where an unlimited number of

// characters may be entered:

VpeSetCharCount(hDoc, 0);

hControl_1 = VpeFormFieldControl(hDoc, 1, 1, -9, VFREE, "Hello\r\nWorld!");

 

// Insert an Interactive Text Control, limited to max. 14 characters:

VpeSetCharCount(hDoc, -14);

hControl_2 = VpeFormFieldControl(hDoc, 1, 2, -9, VFREE, "Hello\r\nWorld!");

 

// Insert an Interactive Form Field Control, limited to max. 14 characters:

VpeSetCharCount(hDoc, 14);

hControl_3 = VpeFormFieldControl(hDoc, 1, 3, -9, VFREE, "Hello World!");

 

See Also:

"Interactive Documents" in the Programmer's Manual.