Cicode Programming Reference > Cicode Function Categories > Form Functions Introduction > FormListAddText

FormListAddText

Adds a new text entry to a combo box or a list box while the form is displayed. It only adds the text to the list - it does not select it. Use the FormListSelectText() function to select (highlight) an entry. Call this function only when the form is displayed, for example, from a field callback function.

Syntax

FormListAddText(hForm, hField, Text)

hForm:

The form handle, returned from the FormNew() function. The form handle identifies the table where all data on the associated form is stored.

hField:

The field handle of the field currently selected.

Text:

The output text string containing the operator's input.

Return Value

0 (zero) if successful, otherwise an error is returned.

Related Functions

FormListSelectText, FormListDeleteText, FormSetText

Example

/* create a form with a list */
hForm = FormNew("Ingredients", 40, 10, 1);
hField = FormListBox(2,2,20,5,sBuf);
FormAddList("Flour");
FormAddList("Water");
FormAddList("Salt");
FormAddList("Sugar");
/* Display the form */
FormRead(1);
..
/*Add Milk to list */
FormListAddText(hForm, hField, "Milk");
..

See Also

Form Functions