Attributes and controls of a browsing Looper control in WINDEV or WINDEV Mobile
A Looper control includes controls that are repeated on each row.
When creating a browsing Looper control, a control is created for each item found in the data file or in the query.
To modify one or more characteristics of these controls (color, state, width, height,...), simply handle them by programming in the event "Displaying a row" of the Looper control.
For example, the Looper control named "LOOP_MyLooper" is based on "Customer" file. This data file contains 10 items (name, address and phone number of each customer for example). When creating the Looper control, 10 controls will be automatically created: each control will be linked to an item of data file "Customer".
To get a different background color for "EDT_CustomerName" on each row, simply handle this control by programming to set the desired background color. For example:
// -- Displaying a row of LOOP_MyLooper
Subscript is int
// Retrieve the subscript of the current row
Subscript = LOOP_MyLooper
IF IsEven(Subscript) = True THEN
// The background color will be red for the even rows
LOOP_MyLooper[Subscript].EDT_CustomerName..BackgroundColor = LightRed
// The background color will be blue for the odd rows
LOOP_MyLooper[Subscript].EDT_CustomerName..BackgroundColor = LightBlue
Remark: For compatibility with WEBDEV, you also have the ability to use the attributes.