|       +-------------------+    |
                 |       V                   |    |

The AddListControl method adds a list view to the dialog and connects it with a data attribute. For further information on list view controls, refer to ListControl Class.


The arguments are:


A unique identifier assigned to the control. You need the ID to refer to this control in other methods.


The name of the data attribute associated with the dialog item. See ConnectTreeControl to get information on what happens when this argument is omitted.

x, y

The position of the upper left corner of the control relative to the dialog, in dialog units.

cx, xy

The width and height of the dialog item, in dialog units.


This argument determines the behavior and style of the dialog item and can be one or more of the following, separated by blanks:


Use the icon view. Each item appears as a full-sized icon with a label below it. The user can drag the items to any location in the list view control.


Use the small-icon view. Each item appears as a small icon with a label to the right of it. The user can drag the items to any location in the list view control.


Use the list view. Each item appears as a small icon with a label to the right of it. Items are arranged in columns and cannot be moved by the user.


Use the report view. Each item appears on a separate line with information arranged in columns. The leftmost column contains the small icon and label, and subsequent columns contain subitems.


In icon and small-icon views, the items are left-aligned.


In icon and small-icon views, the items are aligned with the top of the control.


In icon and small-icon views, the icons are always automatically arranged.


Sorts items by item text in ascending order.


Sorts items by item text in descending order.


The list view allows the user to edit the list view items. To store the edited text, you must connect a method to the ENDEDIT notification or you connect the DEFAULTEDIT event handler (see ConnectTreeNotify).


The list view supports a horizontal scroll bar.


The list view supports a vertical scroll bar.


Disables scrolling.


No column header is displayed in the report view. By default, columns have headers in the report view.


Specifies that column headers do not work like buttons. This option is useful if clicking a header in the report view does not carry out an action.


Displays item text on a single line in the icon view. By default, the item text can wrap in the icon view.


Allows only one item to be selected at a time. By default, several items can be selected.


Specifies that a selected item remains selected when the list view loses focus.


Connects the notification that label editing has been started and ended with a predefined event-handling method. This method extracts the newly entered text from the notification and modifies the item of which the label was edited. If this event is not connected you must provide your own event-handling method and connect it with the BEGINEDIT and ENDEDIT events. Otherwise, the edited text is lost and the item remains unchanged.


The control does not take ownership of the image lists assigned to it. This option enables an image list to be used with several list controls.


Specifies the first control of a group of control in which the user can move from one control to the next with the arrow keys.


The control is initially hidden.


The tab key cannot be used to move to this control.


No border is drawn around the control.

Return value:

The possible return values are:



less than 0

Error with the in-memory dialog template or with the resource ID.


The following example creates a list view at position x=100 and y=80 and with a size of width=40 and height=120. The list view with ID 555 is a report view with items sorted in ascending order. It supports item editing and column headers do not behave like buttons. Its data is associated with attribute EMPLOYEES.

MyDialog~AddListControl(555, "EMPLOYEES", 100, 80, 40, 120, ,