ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / WLanguage / WLanguage functions / Controls, pages and windows / Control functions
  • Declaring a Control variable
  • Assigning a Control variable
  • Using a Control variable in a procedure
  • Optimizing the processes with indirection
  • Properties associated with a Control variable
  • Functions that use a Control variable
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Control (Variable type)
In french: Champ
The Control type is used to define the characteristics of a control. This control can be dynamically created by ControlCreate or it can be a control found in a window or in a report.
Java ControlCreate is not available.
Note: For more details on the declaration of this type of variable and the use of WLanguage properties, see Declaring a variable.
Example
WINDEV
// Dynamically create a control in a window
c is Control
c <- ControlCreate("BUTTON_1", typButton, 30, 40, 140, 20) // Caution, not '='
c.Caption = "Click here"
c.Process[trtClick] = myProcedure
Remarks

Declaring a Control variable

The following syntax is used to declare a Control variable:
<Variable Name> is Control
Example:
c is Control
When declaring a variable of type Field, it is possible to specify the field type using the following syntax:
<Variable name> is a Field <field type = <Field type>>
where <Type de champ> is the constant corresponding to the type of field to be created (see below)..
Example:
MonChamp is TO Field <type control = typButton>
The following constants can be used to define the field type:
typActiveX17ActiveX control
Java
Not available.
typOrganizer76Organizer control
Java
Not available.
typScrollbar18Scrollbar control
Java
Not available.
typAttribute41Attribute of a Looper control
WINDEVJava
Not available.
typSlidingBanner122 Sliding Banner control
WINDEVJava
Not available.
typNavigationBar117Navigation Bar control
WINDEVJava
Not available.
typToolbar22Toolbar control
Java
Not available.
typToolbox29Sidebar control
Java
Not available.
typButton4Button control
New in version 2025
typButtonSegmented
148Segmented Button control
typCalendar47Calendar control
typCaptcha82Captcha control
WINDEVJava
Not available.
typMap92Map control
Java
Not available.
typCarousel37Carousel control
Java
Not available.
typStatusBarBox40002Cells of a status bar
Java
Not available.
typCell50014Cell control
WINDEVJava
Not available.
typCellCSSGrid147Cell control in a CSS Grid field.
WINDEVJava
Not available.
typNavigationBarCell115Cell control in a Navigation Bar control.
WINDEVJava
Not available.
typCellLayout127Cell in a Layout control
Linux Not available.
typCellFlexBox139Cell of a FlexBox control.
WINDEVJava
Not available.
typCellPageLayout84Cell control used for the Zoning layout.
WINDEVJava
Not available.
typFormattedControl50001Formatted display control
WINDEVJava
Not available.
typHTMLControl50002HTML control
WINDEVJava
Not available.
typMenuControl50007Menu of a WEBDEV page
WINDEVJava
Not available.
typContextMenuControl141Context menu in a WEBDEV page
WINDEVJava
Not available.
typBreadcrumb50011Breadcrumb control
WINDEVJava
Not available.
typClick30001Clickable Image control (Image control with the "This image is a clickable area" option).
Java
Not available.
typBarCode26Bar Code control
Java
Not available.
typColumn56Table column
WINDEVJava Not available.
typComboWE10001Editable Combo Box control
typComboNE10002Non-editable Combo Box control
typWebComponent121Web Component control
WINDEVJava
Not available.
typConference25Conference control
Java
Not available.
typNativeContainer125Native Container control
Java
Not available.
typCube38Cube control
Java
Not available.
typDate20002Date Edit control
typLayout126Layout control
Linux Not available.
typDuration20006Duration Edit control
typDiagramEditor130Diagram Editor control
LinuxJava
Not available.
typCodeEditor146Code Editor control
LinuxJava
Not available.
typHtmlEditor134HTML Editor control
LinuxJava
Not available.
typImageEditor124Image Editor control
LinuxJava
Not available.
typMobileImageEditor138Mobile Image Editor control
WINDEVWindowsLinuxJava
Not available.
typWin1Window
typInternalWindow31Internal Window
typWire118Wire control
LinuxJava
Not available.
typFlash50008Flash control
WINDEVJava
Not available.
typFlex48Flex control
WINDEVJava
Not available.
typFlexbox139Flexbox control
Java
Not available.
typShape20Shape/Drawing control
typGantt110Gantt Chart column (Table or TreeView Table control).
Java
Not available.
typChart33Chart control in a window or page
Java
Not available.
typGrp58Group of controls
Java
Not available.
typTime20003Time Edit control
typHTML23HTML static
typIFrame50013IFrame control
WINDEVJava
Not available.
typImage8Image control
typCheckBox5Check Box control
typSwitch132Switch control
Java Not available.
typProgressBar10Progress Bar control
typInfiniteProgressBar113Infinite Progress Bar control
Java Not available.
typJava50004Java control
WINDEVJava
Not available.
typKanban140Kanban control
Java
Not available.
typPDFReaderPDF Reader control
LinuxJava
Not available.
typStatic3Static Text control
typHTMLStatic50006HTML Static control
WINDEVJava
Not available.
typLink50005Link control
WINDEVJava
Not available.
typSocialLink103Social Network control
WINDEVJava
Not available.
typHorizontalRule50003Line control
WINDEVJava
Not available.
typList7List Box control
typListView27ListView control
typKanbanList142Kanban List control
Java
Not available.
typMapArea50010Clickable Image control
WINDEVJava
Not available.
typControlTemplate43Control Template control.
typCurrency20005Currency Edit control
typMultimedia39Multimedia control
Java Not available.
typRating85Rating control
LinuxJava
Not available.
typRepositionableNote119Repositionable Note control
Java
Not available.
typNum20004Numeric Edit control
typOle15OLE control
Java
Not available.
typTab16Tab control
typSwitchOption133Option of a Switch control
Java Not available.
typMenuOption40001Menu option
Java Not available.
typOrganizationChart86Organization Chart control
Java
Not available.
typPage1Page
WINDEVJava
Not available.
typPeelingCorner79Peeling Corner control
WINDEVJava
Not available.
typInternalPage31Internal page
WINDEVJava
Not available.
typPanel131Dockable Panel control
Java
Not available.
typSlidingBannerPlane123Plane associated with a Sliding Banner control
WINDEVJava
Not available.
typSiteMap45Site Map control
WINDEVJava
Not available.
typScheduler80Scheduler
Java
Not available.
typPopup90Popup page
WINDEVJava
Not available.
typSlider12Slider control
Java
Not available.
typRangeSlider72Range Slider
WINDEVJava
Not available.
typRotativeSlider13Round Slider
Java
Not available.
typRangeSlider72Range Slider control
Java
Not available.
typPager50009Pager control
WINDEV
Not available.
typRibbonGroupRibbon group
Java
Not available.
typRibbon87Ribbon control
Java
Not available.
typBreakBreak in a Looper control
WINDEVJava
Not available.
typSelect6Radio Button control
typSplitter28Splitter control
Java
Not available.
typSilverlight46SilverLight control
WINDEVJava
Not available.
typSpin11Spin control
typSuperControl40Supercontrol
typTable9Table control
typPivotTable102Pivot Table control
Java
Not available.
typDashboard111Dashboard control
typTreeviewTable35TreeView Table control
typSpreadsheet114Spreadsheet control
Java
Not available.
typText20001Text Edit control
typDrawer34Drawer control
Java
Not available.
typWordProcessing120Word Processing control
Java
Not available.
typTreeMap74TreeMap control
Java
Not available.
typTreeView19TreeView control
typUpload73Upload control
WINDEVJava
Not available.
typVideo78Video control
WINDEVJava
Not available.
typThumbnail50012Thumbnail control
WINDEVJava
Not available.
typWebCam24Web Camera control
typXaml36Xaml control
Java
Not available.
typMultilineZone97Multiline Zone control
WINDEVWindowsLinuxJava
Not available.
typLooper30Looper control
typLinearLooper77Linear Looper control
WINDEVJava Not available.
typRichTextArea109Text Area control
WINDEVJava Not available.
Note: To stop associating a field with a variable of type Field, simply use the VariableReset function..

Assigning a Control variable

A Control variable can be used to handle:
  • a control found in a window or in a report.
  • WINDEV a control created by ControlCreate.
The assignment of a Control variable must be performed by the '<-' operator.
Examples:
// Assignment with an existing control
c is Control
c <- EDT_Edit1
// Assignment by using the indirection
// The variable references the EDT_EDIT2 control
c <- {"EDT_EDIT2"}
WINDEV
// Assignment with a control created by ControlCreate
c is Control
c <- ControlCreate("BUTTON_1", typButton, 30, 40, 140, 20)
Caution: The '=' operator must not be used to assign a variable of type Champ. This operator is used to transfer the value of a control into another control of the same type. For example:
// Assignment with an existing control
c is Control
c <- EDT_Edit1

// Modify the value 
c = SAI_Saisie3 // Equivalent code: SAI_Saisie1.Valeur = SAI_Saisie3.Valeur
c = "Text" // Equivalent code: SAI_Saisie1.Value = "Text"
Note: To find out whether the type variable Champ has been assigned, use the Type property on the variable.. Example:
PROCEDURE VariableChampEstAffecté(varChamp is TO Field) : boolean
// Purpose: to check whether a field has been assigned to a variable of type Field 
sType is int
WHEN EXCEPTION IN
	sType = varChamp..Type
DO
	RETURN False
END
RETURN True

Using a Control variable in a procedure

The Control type can be a parameter of a procedure.
Method 1: Use of the syntax without specifying the field type:
  • the procedure code is:
    PROCEDURE MyProcedure(C is Control)
    C = "It is " + TimeSys()
  • the procedure call is of the type:
    MyProcedure(EDT_Edit1)
In this case, if the field type is not the expected one, no check is performed at compile time..
Method 2: Use of the syntax specifying the type of field used:
  • the procedure code is:
    PROCEDURE MyProcedure(This is TO Field <type control = typSaisie>)
    C = "It is " + TimeSys()
  • the procedure call is of the type:
    MyProcedure(EDT_Edit1)
Advantage: If the procedure call uses a field of a different type from the expected one, a compilation error is displayed: "Passing the field in parameter is not compatible with the expected field."

Optimizing the processes with indirection

The Control type can be used to optimize the processes that use the indirections. You can write for example:
C is Control <-{s, indControl}
C.Width = 10
C.Height = 20
rather than the following code:
{s, indControl}..Width = 10
{s, indControl}..Height = 20

Properties associated with a Control variable

The Control type is used to manipulate all types of controls found in a window or in a report. The available properties depend on the type of control used.
Thus, if a variable of type Field is used to manipulate an input field, all the WLanguage properties available on the input field can be used on the variable of type Field. By specifying the field type when declaring the Champtype variable, only the properties of the specified field type are proposed in the code editor.
To find out about the properties of a field, consult the field's help page: the "See also" link gives access to all the field's properties.. For more details, see Window controls.

Functions that use a Control variable

All the WLanguage functions that manipulate the controls can be used on a Control variable. However, only the WLanguage functions corresponding to the type of control used will be available. By specifying the field type when declaring the Champtype variable, only those functions that manipulate the specified field type are proposed in the code editor.
Therefore, the TableXXX functions can be used on a Control variable that handles a Table control.
Minimum version required
  • Version 19
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 12/19/2024

Send a report | Local help