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.
AndroidAndroid Widget 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
WEBDEV - Server codeAndroidAndroid Widget iPhone/iPadIOS WidgetJava
Not available.
typOrganizer76Organizer control
AndroidAndroid Widget iPhone/iPadIOS WidgetJava
Not available.
typScrollbar18Scrollbar control
WEBDEV - Server codeAndroidAndroid Widget iPhone/iPadIOS WidgetJava
Not available.
typAttribute41Attribute of a Looper control
WINDEVAndroid Widget Java
Not available.
typSlidingBanner122 Sliding Banner control
WINDEVAndroidAndroid Widget iPhone/iPadIOS WidgetJava
Not available.
typNavigationBar117Navigation Bar control
WINDEVAndroidAndroid Widget iPhone/iPadIOS WidgetJava
Not available.
typToolbar22Toolbar control
WEBDEV - Server codeAndroidAndroid Widget iPhone/iPadIOS WidgetJava
Not available.
typToolbox29Sidebar control
WEBDEV - Server codeAndroidAndroid Widget iPhone/iPadIOS WidgetJava
Not available.
typButton4Button control
New in version 2025
typButtonSegmented
148Segmented Button control
WEBDEV - Server code
Not available.
typCalendar47Calendar control
Android Widget Not available.
typCaptcha82Captcha control
WINDEVAndroidAndroid Widget iPhone/iPadIOS WidgetJava
Not available.
typMap92Map control
Android Widget Java
Not available.
typCarousel37Carousel control
WEBDEV - Server codeAndroidAndroid Widget iPhone/iPadIOS WidgetJava
Not available.
typStatusBarBox40002Cells of a status bar
WEBDEV - Server codeAndroidAndroid Widget iPhone/iPadIOS WidgetJava
Not available.
typCell50014Cell control
WINDEVAndroidAndroid Widget iPhone/iPadIOS WidgetJava
Not available.
typCellCSSGrid147Cell control in a CSS Grid field.
WINDEVAndroidAndroid Widget iPhone/iPadIOS WidgetJava
Not available.
typNavigationBarCell115Cell control in a Navigation Bar control.
WINDEVAndroidAndroid Widget iPhone/iPadIOS WidgetJava
Not available.
typCellLayout127Cell in a Layout control
LinuxAndroid Widget Not available.
typCellFlexBox139Cell of a FlexBox control.
WINDEVAndroidAndroid Widget iPhone/iPadIOS WidgetJava
Not available.
typCellPageLayout84Cell control used for the Zoning layout.
WINDEVAndroidAndroid Widget iPhone/iPadIOS WidgetJava
Not available.
typFormattedControl50001Formatted display control
WINDEVAndroidAndroid Widget iPhone/iPadIOS WidgetJava
Not available.
typHTMLControl50002HTML control
WINDEVAndroidAndroid Widget iPhone/iPadIOS WidgetJava
Not available.
typMenuControl50007Menu of a WEBDEV page
WINDEVAndroidAndroid Widget iPhone/iPadIOS WidgetJava
Not available.
typContextMenuControl141Context menu in a WEBDEV page
WINDEVAndroidAndroid Widget iPhone/iPadIOS WidgetJava
Not available.
typBreadcrumb50011Breadcrumb control
WINDEVAndroidAndroid Widget iPhone/iPadIOS WidgetJava
Not available.
typClick30001Clickable Image control (Image control with the "This image is a clickable area" option).
WEBDEV - Server codeiPhone/iPadIOS WidgetJava
Not available.
typBarCode26Bar Code control
WEBDEV - Server codeAndroidAndroid Widget iPhone/iPadIOS WidgetJava
Not available.
typColumn56Table column
WINDEVAndroid Widget Java Not available.
typComboWE10001Editable Combo Box control
Android Widget iPhone/iPadIOS Widget Not available.
typComboNE10002Non-editable Combo Box control
Android Widget iPhone/iPadIOS Widget Not available.
typWebComponent121Web Component control
WINDEVAndroidAndroid Widget iPhone/iPadIOS WidgetJava
Not available.
typConference25Conference control
WEBDEV - Server codeAndroid Widget Java
Not available.
typNativeContainer125Native Container control
WEBDEV - Server codeAndroid Widget Java
Not available.
typCube38Cube control
WEBDEV - Server codeAndroidAndroid Widget iPhone/iPadIOS WidgetJava
Not available.
typDate20002Date Edit control
Android Widget Not available.
typLayout126Layout control
LinuxAndroid Widget Not available.
typDuration20006Duration Edit control
Android Widget Not available.
typDiagramEditor130Diagram Editor control
LinuxAndroidAndroid Widget iPhone/iPadIOS WidgetJava
Not available.
typCodeEditor146Code Editor control
WEBDEV - Server codeLinuxAndroidAndroid Widget iPhone/iPadIOS WidgetJava
Not available.
typHtmlEditor134HTML Editor control
WEBDEV - Server codeLinuxAndroid Widget IOS WidgetJava
Not available.
typImageEditor124Image Editor control
WEBDEV - Server codeLinuxAndroidAndroid Widget iPhone/iPadIOS WidgetJava
Not available.
typMobileImageEditor138Mobile Image Editor control
WINDEVWEBDEV - Server codeWindowsLinuxAndroid Widget IOS WidgetJava
Not available.
typWin1Window
WEBDEV - Server code Not available.
typInternalWindow31Internal Window
WEBDEV - Server codeAndroid Widget iPhone/iPadIOS Widget Not available.
typWire118Wire control
WEBDEV - Server codeLinuxAndroidAndroid Widget iPhone/iPadIOS WidgetJava
Not available.
typFlash50008Flash control
WINDEVAndroidAndroid Widget iPhone/iPadIOS WidgetJava
Not available.
typFlex48Flex control
WINDEVAndroidAndroid Widget iPhone/iPadIOS WidgetJava
Not available.
typFlexbox139Flexbox control
WEBDEV - Server codeAndroidAndroid Widget IOS WidgetJava
Not available.
typShape20Shape/Drawing control
AndroidAndroid Widget iPhone/iPadIOS Widget
Not available.
typGantt110Gantt Chart column (Table or TreeView Table control).
WEBDEV - Server codeAndroidAndroid Widget iPhone/iPadIOS WidgetJava
Not available.
typChart33Chart control in a window or page
AndroidAndroid Widget Java
Not available.
typGrp58Group of controls
Android Widget iPhone/iPadIOS WidgetJava
Not available.
typTime20003Time Edit control
Android Widget Not available.
typHTML23HTML static
AndroidAndroid Widget iPhone/iPadIOS Widget
Not available.
typIFrame50013IFrame control
WINDEVAndroidAndroid Widget iPhone/iPadIOS WidgetJava
Not available.
typImage8Image control
typCheckBox5Check Box control
Android Widget Not available.
typSwitch132Switch control
Android Widget Java Not available.
typProgressBar10Progress Bar control
AndroidAndroid Widget iPhone/iPadIOS Widget Not available.
typInfiniteProgressBar113Infinite Progress Bar control
WEBDEV - Server codeAndroid Widget Java Not available.
typJava50004Java control
WINDEVAndroidAndroid Widget iPhone/iPadIOS WidgetJava
Not available.
typKanban140Kanban control
Android Widget iPhone/iPadIOS WidgetJava
Not available.
typPDFReaderPDF Reader control
WEBDEV - Server codeLinuxAndroidAndroid Widget iPhone/iPadIOS WidgetJava
Not available.
typStatic3Static Text control
typHTMLStatic50006HTML Static control
WINDEVAndroidAndroid Widget iPhone/iPadIOS WidgetJava
Not available.
typLink50005Link control
WINDEVAndroidAndroid Widget iPhone/iPadIOS WidgetJava
Not available.
typSocialLink103Social Network control
WINDEVAndroidAndroid Widget iPhone/iPadIOS WidgetJava
Not available.
typHorizontalRule50003Line control
WINDEVAndroidAndroid Widget iPhone/iPadIOS WidgetJava
Not available.
typList7List Box control
Android Widget Not available.
typListView27ListView control
WEBDEV - Server codeAndroidAndroid Widget iPhone/iPadIOS Widget
Not available.
typKanbanList142Kanban List control
Android Widget iPhone/iPadIOS WidgetJava
Not available.
typMapArea50010Clickable Image control
WINDEVAndroidAndroid Widget iPhone/iPadIOS WidgetJava
Not available.
typControlTemplate43Control Template control.
typCurrency20005Currency Edit control
Android Widget Not available.
typMultimedia39Multimedia control
WEBDEV - Server codeAndroid Widget Java Not available.
typRating85Rating control
LinuxAndroidAndroid Widget iPhone/iPadIOS WidgetJava
Not available.
typRepositionableNote119Repositionable Note control
WEBDEV - Server codeAndroidAndroid Widget iPhone/iPadIOS WidgetJava
Not available.
typNum20004Numeric Edit control
Android Widget Not available.
typOle15OLE control
WEBDEV - Server codeAndroidAndroid Widget iPhone/iPadIOS WidgetJava
Not available.
typTab16Tab control
Android Widget Not available.
typSwitchOption133Option of a Switch control
Android Widget Java Not available.
typMenuOption40001Menu option
Android Widget iPhone/iPadIOS WidgetJava Not available.
typOrganizationChart86Organization Chart control
WEBDEV - Server codeAndroidAndroid Widget iPhone/iPadIOS WidgetJava
Not available.
typPage1Page
WINDEVAndroidAndroid Widget iPhone/iPadIOS WidgetJava
Not available.
typPeelingCorner79Peeling Corner control
WINDEVAndroidAndroid Widget iPhone/iPadIOS WidgetJava
Not available.
typInternalPage31Internal page
WINDEVAndroidAndroid Widget iPhone/iPadIOS WidgetJava
Not available.
typPanel131Dockable Panel control
WEBDEV - Server codeAndroidAndroid Widget iPhone/iPadIOS WidgetJava
Not available.
typSlidingBannerPlane123Plane associated with a Sliding Banner control
WINDEVAndroidAndroid Widget iPhone/iPadIOS WidgetJava
Not available.
typSiteMap45Site Map control
WINDEVAndroidAndroid Widget iPhone/iPadIOS WidgetJava
Not available.
typScheduler80Scheduler
AndroidAndroid Widget iPhone/iPadIOS WidgetJava
Not available.
typPopup90Popup page
WINDEVAndroidAndroid Widget iPhone/iPadIOS WidgetJava
Not available.
typSlider12Slider control
AndroidAndroid Widget iPhone/iPadIOS WidgetJava
Not available.
typRangeSlider72Range Slider
WINDEVAndroidAndroid Widget iPhone/iPadIOS WidgetJava
Not available.
typRotativeSlider13Round Slider
WEBDEV - Server codeAndroidAndroid Widget iPhone/iPadIOS WidgetJava
Not available.
typRangeSlider72Range Slider control
WEBDEV - Server codeAndroidAndroid Widget iPhone/iPadIOS WidgetJava
Not available.
typPager50009Pager control
WINDEVAndroidAndroid Widget iPhone/iPadIOS Widget
Not available.
typRibbonGroupRibbon group
WEBDEV - Server codeAndroidAndroid Widget iPhone/iPadIOS WidgetJava
Not available.
typRibbon87Ribbon control
WEBDEV - Server codeAndroidAndroid Widget iPhone/iPadIOS WidgetJava
Not available.
typBreakBreak in a Looper control
WINDEVAndroidAndroid Widget iPhone/iPadIOS WidgetJava
Not available.
typSelect6Radio Button control
typSplitter28Splitter control
WEBDEV - Server codeAndroidAndroid Widget iPhone/iPadIOS WidgetJava
Not available.
typSilverlight46SilverLight control
WINDEVAndroidAndroid Widget iPhone/iPadIOS WidgetJava
Not available.
typSpin11Spin control
WEBDEV - Server codeAndroid Widget iPhone/iPadIOS Widget
Not available.
typSuperControl40Supercontrol
typTable9Table control
Android Widget Not available.
typPivotTable102Pivot Table control
WEBDEV - Server codeAndroidAndroid Widget iPhone/iPadIOS WidgetJava
Not available.
typDashboard111Dashboard control
AndroidAndroid Widget iPhone/iPadIOS Widget Not available.
typTreeviewTable35TreeView Table control
AndroidAndroid Widget iPhone/iPadIOS Widget Not available.
typSpreadsheet114Spreadsheet control
WEBDEV - Server codeAndroidAndroid Widget iPhone/iPadIOS WidgetJava
Not available.
typText20001Text Edit control
Android Widget Not available.
typDrawer34Drawer control
AndroidAndroid Widget iPhone/iPadIOS WidgetJava
Not available.
typWordProcessing120Word Processing control
WEBDEV - Server codeAndroidAndroid Widget iPhone/iPadIOS WidgetJava
Not available.
typTreeMap74TreeMap control
WEBDEV - Server codeAndroidAndroid Widget iPhone/iPadIOS WidgetJava
Not available.
typTreeView19TreeView control
AndroidAndroid Widget iPhone/iPadIOS Widget Not available.
typUpload73Upload control
WINDEVAndroidAndroid Widget iPhone/iPadIOS WidgetJava
Not available.
typVideo78Video control
WINDEVAndroidAndroid Widget iPhone/iPadIOS WidgetJava
Not available.
typThumbnail50012Thumbnail control
WINDEVAndroidAndroid Widget iPhone/iPadIOS WidgetJava
Not available.
typWebCam24Web Camera control
AndroidAndroid Widget iPhone/iPadIOS Widget
Not available.
typXaml36Xaml control
WEBDEV - Server codeAndroidAndroid Widget iPhone/iPadIOS WidgetJava
Not available.
typMultilineZone97Multiline Zone control
WINDEVWEBDEV - Server codeWindowsLinuxAndroidAndroid Widget Java
Not available.
typLooper30Looper control
Android Widget Not available.
typLinearLooper77Linear Looper control
WINDEVAndroidAndroid Widget iPhone/iPadIOS WidgetJava Not available.
typRichTextArea109Text Area control
WINDEVAndroidAndroid Widget iPhone/iPadIOS WidgetJava 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