Both the List Box and Combo Box objects allow readers to select from a list of items. These objects allow a large number of choices to be displayed in a relatively small space. List and Combo Boxes differ only in how they appear on screen. List Boxes display items in a rectangular window with a scroll bar (if needed). Combo Boxes are more compact - displaying only the selected item along with a small button that can be clicked to display the entire list. Other than that, both objects are created and used in the same manner.


To create a List or Combo Box, use the mouse to draw a rectangle where you would like the object to appear. The List Box or Combo Box Properties screen will be displayed allowing you to define the object’s appearance and behavior.



Both the List and Combo Box Properties screens are divided into two sections indicated by the icon images on the left: General and Actions. To view the settings for a section, click the corresponding icon.


General

Create items to be displayed by entering them into the List Items field. As you type your list, use the Enter key to separate each item. Each item should appear on a line of its own. Enter as many items as you wish, keeping in mind that the size of the object and the font size determine how the list is presented.


Enable the Sort alphabetically option to organize the list into ascending order using the first letter of each item.


Enabling the Use Windows theme option (ComboBox Tool only) will display the object using the Windows XP/Vista style. This feature only works when your publication is viewed under Windows XP and Vista. When viewed under older versions of Windows, the ComboBox will be drawn using the normal method.


In order to keep track of the which item in the list is selected while your publication is running, you can assign the List/Combo Box a unique variable name. VisualNEO Win will automatically assign a variable name that matches the Object Name, but you may change this by modifying the Variable (to store selected item) field. At runtime, the variable can contain either the Item number or Item text. If the Item Number option is enabled, the variable will contain the line number of the selected item in the list. The first item is “1,” the second item is “2,” and so on. If Item Text is chosen, the variable will contain the actual text of the item selected. For example, if the second item is “Apple,” and that item is selected, the variable will contain the word “Apple.”


In addition, List Boxes include an extra check box under Variable Contains that you can use to specify if the object will Allow multiple selections. This can be useful in circumstances where you want to allow the reader to select more than one item. When this option is enabled, the variable assigned to the List Box may contain more than one item. Multiple items will be separated by carriage returns, so you will need to use an Action like StrParse to find out which items were selected. For example:


StrParse "[ListBox1]" "[#13]" "[SelectedItems]" "[ItemCount]"

AlertBox "Hello" "You selected [ItemCount] items."


Note: The [#13] code above is used by VisualNEO Win to indicate a carriage return.


Actions

Both List and Combo Boxes support the following Action Events: Selection Changed, Mouse Enter and Mouse Exit. In addition, List Boxes support Right Click and Double Click actions. Click the appropriate tab at the bottom of the Action Editor to create or edit Actions for the events you want to control. See Understanding Actions and Variables and Action Command Reference for a complete discussion of the Action Editor and Action Commands.


Hint: VisualNEO Win provides several Action Commands that can be used to add, delete, find or sort items in a List or Combo Box. This allows you to create dynamic lists that change as your publication progresses.