PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
  • Overview of ListView control
  • Creating the ListView control
  • Vocabulary
  • Swapping
  • ListView control/ Looper control
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Overview of ListView control
The ListView control is used to display a list of graphic elements (images, logo, ... ) and to select one or more elements in this list.
Several display modes are available:
  • ListView mode: The listview is expanded, which means that several listview elements are displayed in the window.
  • Standard List Box mode: The images are not displayed in the listview. Only the captions are displayed.
These elements can:
  • be defined by programming.
  • come from a data file or from a query.
Remark: A listview can be used to perform an automatic Drag and Drop. See Managing Drag and Drop for more details.
Creating the ListView control
To create a ListView control:
  1. In the window editor, click (or select "Insert .. Control .. ListView") .On the "Creation" pane, in the "Data" group:
    • Windows Mobile expand "List" and select "ListView".
  2. Click the position where the control will be created in the window. The wizard for creating a ListView control is automatically started.
To display the control characteristics, select "Description" from the popup menu of control.
Vocabulary
To easily handle a ListView control, you must be familiar with the following vocabulary:
NameDefinition
ElementA ListView control is composed of several elements. Each element includes an image and a caption.
Display modeA 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.
Selection barUsed to view the selected element. A specific color is used in most cases.
Browsing ListViewThe 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 browsing ListView controls:
  • Browsing ListView control "Loaded in memory": 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 the data files containing less than 100 000 records.
  • Browsing ListView control in "Direct access (no limit)": The ListView control displays the content of the data file or query directly. The current record corresponds to the selected element. Each move performed in the ListView control involves an access to the linked data file. This type of ListView control is reserved for data files with more than 100,000 records.
Memory ListViewThe ListView is not based on a data file or query. The elements displayed in the ListView control are determined by the developer, by programming.
Single-selection ListViewThe user can select a single element in the ListView control.
Multiselection ListViewThe user can select several elements at the same time in the ListView control (simply using the Ctrl key).
Vertical/Horizontal scrollScroll direction of the ListView control.
If the number of elements displayed in the ListView control exceeds the number of visible elements, a vertical scrollbar automatically appears.
If the size of the elements is larger than the width of the ListView control, a horizontal scrollbar automatically appears.
Listview on sourceThe ListView control is based on a variable (global to the project, to the window or to the page, class member, etc.).
Swapping
Versions 16 and later

ListView control/ Looper control

A ListView control can be automatically transformed into a Looper control:
  1. Select the ListView control to transform.
  2. Select "Control .. Swap .. ListView to Looper".On the "Modification" pane, in the "Transformations" group, expand "Refactoring and swapping" and select "ListView to Looper".
New in version 16

ListView control/ Looper control

A ListView control can be automatically transformed into a Looper control:
  1. Select the ListView control to transform.
  2. Select "Control .. Swap .. ListView to Looper".On the "Modification" pane, in the "Transformations" group, expand "Refactoring and swapping" and select "ListView to Looper".

ListView control/ Looper control

A ListView control can be automatically transformed into a Looper control:
  1. Select the ListView control to transform.
  2. Select "Control .. Swap .. ListView to Looper".On the "Modification" pane, in the "Transformations" group, expand "Refactoring and swapping" and select "ListView to Looper".
Related Examples:
The ListView control 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).
PC Photo Album Windows (WINDEV Mobile): PC Photo Album
[ + ] The PC Photo Album example is used to import and export the photos of a Smartphone or Pocket PC from the PC.
A listview is used to preview the photos found on the Smartphone and on the Pocket PC.
Pocket Images Mobile (WINDEV Mobile): Pocket Images
[ + ] Image explorer for Pocket PC
Summary of the example supplied with WINDEV Mobile:
This example is used to browse a directory in order to find images.
The images are displayed in a ListView control.
To view the image in real size, double-click the image in the ListView control.
If the image is bigger than the size of the screen, scrollbars are automatically displayed in order to view the entire image.
Minimum version required
  • Version 9
This page is also available for…
Comments
VIDEO LISTVIEW
https://youtu.be/dPnDg8UDgRY
amarildo
08 Jan. 2019