- Overview of the ListView control
- Creating a ListView control
- Specific features of Panorama mode
- ListView control / Looper control
Overview of the ListView control
The ListView control is used to display a list of graphic elements (images, logos, etc.) and to select one or more elements in this list.
Several display modes are available:
- ListView mode: The ListView is expanded, i.e., several elements are displayed in the window.
- Standard List Box mode: Images are not displayed in the ListView. Only captions are displayed.
- Panorama mode: The images appear as if they were displayed on a curved wall.
These elements can:
- be defined through programming.
- come from a data file or query.
: A ListView can be used to perform an automatic Drag and Drop. For more details, see Managing Drag and Drop
Creating a ListView control
To create a ListView control:
- On the "Creation" tab, in the "Data" group, expand "Table and List Box" and select "ListView".
- Click at the desired location to create the control. The ListView control creation wizard starts automatically.
To view the characteristics of the control, select "Description" in the context menu.
Specific features of Panorama mode
- The ListView control can display up to 20 images. If the list contains more elements, the additional elements will be available but will not be visible to the user.
- Some features are not available: management of scrollbars, etc
To easily handle a ListView control, you must be familiar with the following vocabulary:
|Element||A ListView control is composed of several elements. Each element includes an image and a caption.|
|Display mode||A ListView control can be displayed:|
- in "ListView" mode: the ListView control will display images and captions.
- in "Standard List Box" mode: the ListView control will only display captions.
- in "Panorama" mode: the ListView control will display the images with a curved effect.
|Selection bar||Used to view the selected element. A specific color is used in most cases.|
|ListView based on a data file||The ListView control is based on a data file or a query. The elements of the ListView correspond to the records of the data file.|
There are two types of ListView controls based on a data file:
- ListView control with in-memory data source: the content of the ListView control is loaded in memory, then displayed. The elements of the ListView control can be accessed more quickly. This mode is reserved for data files with less than 100,000 records.
- ListView control with direct access to the data source (no limit): The ListView control displays the content of the data file or query directly. The current record corresponds to the selected element. Selecting an element in the ListView control triggers an access to the linked data file. This type of ListView control is reserved for data files with more than 100,000 records.
|ListView control populated programmatically||The ListView is not based on a data file or query. The elements displayed in the ListView control are determined by the developer, through programming.|
|Single-selection ListView||The user can select a single element in the ListView control. |
|Multi-selection ListView||The user can select several elements at the same time in the ListView control (using the Ctrl key).|
|Vertical/Horizontal scroll||Scroll direction of the ListView control.|
A vertical scrollbar appears automatically if the number of elements in the ListView control exceeds the number of visible elements.
A horizontal scrollbar appears automatically if the size of the elements is larger than the width of the ListView control.
|ListView based on a variable||The ListView control is based on a variable (global to the project, window or page; class member, etc.).|
ListView control / Looper control
A ListView control can be automatically transformed into a Looper control:
- Select the ListView control to transform.
- On the "Modification" tab, in the "Transformations" group, expand "Refactoring and swapping" and select "ListView to Looper".
Unit examples (WINDEV): The ListView control
[ + ]
Using the ListView control of WINDEV.
The ListView control is used to display the content of a list in thumbnail format.
Like the List Box or Table controls, the ListView control can be a "memory" control (filled by programming) or a "browsing" control (linked to a database).
This page is also available for…