Description
Inserts a combobox type form field at the current text input position in a RichTextEdit control. A combobox has a list of items in its dropdown and text in its edit field. After a combobox is inserted, the edit field shows the text. If a user clicks at the text, the combobox will display with the list of items.
Applies to
Syntax 1
rtename.FormComboBoxInsert(string fieldText, string items[], boolean showDropDownArrow{, integer emptyWidth})
Argument |
Description |
---|---|
fieldText |
The text that displays in the edit field of the combobox. |
items[] |
The item options to display in the combobox when the user clicks at the combobox field. |
showDropDownArrow | The option that decides whether the combobox's dropdown arrow is immediately shown after insertion. |
emptyWidth | The combobox's width, in twips, when its edit field is empty. If this parameter is omitted, a default width of 2000 twips is used. For almost all units of measurement in the RichTextEdit control, twips are used. Twip is a fabricated word meaning twentieth of a point (pt). |
Syntax 2
rtename.FormComboBoxInsert(string items[], integer selectedIndex, boolean showDropDownArrow{, integer emptyWidth})
Argument |
Description |
---|---|
items[] |
String array. The item options to display in the combobox when the user clicks at the combobox field. |
selectedIndex | The index of the item that displays in the edit field of the combobox. If the index is 0, the edit field is empty. If the index is n, the nth item in items[] displays in the edit field. |
showDropDownArrow | Boolean. The option that decides whether the combobox's dropdown arrow is immediately shown after insertion. |
emptyWidth | The combobox's width, in twips, when its edit field is empty. If this parameter is omitted, a default width of 2000 twips is used. For almost all units of measurement in the RichTextEdit control, twips are used. Twip is a fabricated word meaning twentieth of a point (pt). |
Return value
Integer.
Returns a value greater than 0 if it succeeds and this value represents the unique ID of the form field that was successfully inserted. If any argument's value is null, returns null. Returns -1 if an error occurs.
Examples
This example inserts a combobox form field which shows "Display name" in the edit field, and when the field is inserted, the dropdown list shows "A", "B", and "C" options.
integer li_rtn string li_items[] li_items[] = {"A", "B", "C"} li_rtn= rte_1.FormComboBoxInsert("Display name", li_items[], true)
This example inserts a combobox form field which does not display text in the edit field.
string ls_items[] integer li_rtn ls_items[] = {"Test Item1","Test Item2","Test Item3","Test Item4","Test Item5"} li_rtn = rte_1.FormComboBoxInsert(ls_items[],0,false,3000)