Help / WLanguage / WLanguage functions / Controls, pages and windows / Control functions
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WindowsLinuxPHPWEBDEV - Browser code
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Stored procedures
Creates a new control (of any type) in a window through programming.
c is Control
c <- ControlCreate("BUTTON_1", typButton, 30, 40, 140, 20)
c.Caption = "Click here"
c.Process[trtClick] = myProcedure
ControlCreate("EDIT_1", typDate, 30, 40, 140, 20)
ctrl is Control
ctrl <- ControlCreate("DATE", typDate, 150, 150, 80, 20)
ctrl.CaptionWidth = 40
ctrl.Caption = "Date"
// Create a Table control with its columns
cTable is Control
cTable <- ControlCreate("cTable", typTable, 0, 0, 300, 250, True)
cTable.Anchor = anchorWidth + anchorHeight
col1 is Control <- ControlCreate("cTable.COL1", typColumn)
col1.InputType = typInputText
col2 is Control <- ControlCreate("cTable.COL2", typColumn)
col2.InputType = typInputTime
col3 is Control <- ControlCreate("cTable.COL3", typColumn)
col3.InputType = typInputNum
TableAddLine(c, "cTable", "Col 1", "1224", "25")
<Result> = ControlCreate(<Name> , <Type> [, <X> [, <Y> [, <Width> [, <Height> [, <Visible>]]]]])
<Result>: Control variable
The new control can be handled with a variable of type Control. In this case, values must be assigned with the '<-' operator.
If ControlCreate is used directly, the control is created in the window and is visible by default.
<Name>: Character string
Name that will be given to the new control. This name will be used to handle the control through programming.
A WLanguage error occurs if this name already exists.
If this parameter corresponds to an empty string (""), a unique name is automatically created.
Special cases:
  • Creating a control in a "Parent" control: specify the full name of the control to be created. For example: "Tab[1].Button2".
  • Creating an edit column in a Table control: specify the typColumn type and name of the Table control before the column name. For example:
    // Edit + Date column
    c <- ControlCreate("TABLE1.COL3", typColumn)
    c.Width = 100
    c.InputType = typInputDate
  • Creating a simple column in a Table control: specify the type of column and the name of Table control before the column name. For example:
    // Image column
    c2 is Control <- ControlCreate("Table1.Col3", typImage)
    c2.Width = 50
  • Creating tab panes : specify the typTabPane type and the tab name. For example:
    ControlCreate("TAB1", typTabPane)
  • Creating a Text token edit control: Simply create a text edit control and enable tokens. For example:
    MyControl is Control <- ControlCreate("test", typText, 10, 10, 250, 25)
    MyControl.TokenEnabled = True
<Type>: Integer constant
Type of control to create:
typActiveXActiveX control
typOrganizerOrganizer control
typScrollbarScrollbar control
typToolbarToolbar control
typToolboxSidebar control
typButtonButton control
typCalendarCalendar control
typCarouselCarousel control
typMapMap control
typClickClickable Image control (Image control with the "This image is a clickable area" option).
typBarCodeBar Code control
typColumnTable Column control
typComboWEEditable Combo Box control
typComboNENon-editable Combo Box control
typConferenceConference control
typNativeContainerNative Container control
typCubeCube control
typDateDate Edit control
typDurationDuration Edit control
New in version 2024
Code Editor control
typDiagramEditorDiagram Editor control
typHtmlEditorHTML Editor control
typImageEditorImage Editor control
typMobileImageEditorMobile Image Editor control
WINDEV Not available.
typInternalWindowInternal Window control
typWireWire control
typShapeShape/Drawing control
typGanttGantt Chart column
typChartChart control
typTimeTime Edit control
typHTMLHTML Display control
typImageImage control
typCheckBoxCheck Box control
typSwitchSwitch control
typProgressBarProgress Bar control
typInfiniteProgressBarInfinite Progress Bar control
typKanbanKanban control
typPDFReaderPDF Reader control
typStaticStatic control
typListList Box control
typListViewListView control
typKanbanListKanban List control
typCurrencyCurrency Edit control
typMultimediaMultimedia control
typRatingRating control
typRepositionableNoteRepositionable Note control
typNumNumeric Edit control
typOleOLE control
typTabTab control
typOrganizationChartOrganization Chart control
typPanelDockable Panel control
typSchedulerScheduler control
typSliderSlider control
typRotativeSliderRound Slider control
typRangeSliderRange Slider control
typRibbonRibbon control
typSelectRadio Button control
typSplitterSplitter control
typSpinSpin control
typTableTable control
typPivotTablePivot Table control
typDashboardDashboard control
typTreeviewTableTreeView Table control
typSpreadsheetSpreadsheet control
typTextText Edit control
typDrawerDrawer control
typWordProcessingWord Processing control
typTreeMapTreeMap control
typTreeViewTreeView control
typTabPaneTab Pane control
typWebCamWeb Camera control
typXamlXaml control
typMultilineZoneMultiline Zone control
typLooperLooper control

A WLanguage error occurs if the type is invalid.
<X>: Optional integer
X-coordinate of control to create (position on the X-axis) in pixels. Horizontal position of the upper-left corner of the control, relative to the upper-left corner of the window's client area (i.e. the window without title bar, menu bar or borders). This parameter corresponds to the XInitial property.
If this parameter is not specified, the X-coordinate of control is set to 0.
This value can be changed with the X property.
<Y>: Optional integer
Y-coordinate of control to create (position on the Y-axis) in pixels. Vertical position of the upper-left corner of the control, relative to the upper-left corner of the window's client area (i.e. the window without title bar, menu bar or borders). This parameter corresponds to the YInitial property.
If this parameter is not specified, the Y-coordinate of control is set to 0.
This value can be changed with the Y property.
<Width>: Optional integer
Width of control to create (expressed in pixels). This parameter corresponds to the InitialWidth property.
If this parameter is not specified, the control width is set to 0.
This value can be changed with the Height property.
<Height>: Optional integer
Height of control to create (expressed in pixels). This parameter corresponds to the InitialHeight property.
If this parameter is not specified, the control height is set to 0.
This value can be changed with the Width property.
<Visible>: Optional boolean
  • True (default value) if the control must be visible,
  • False to create an invisible control.
This value can be changed with the Visible property.
  • WINDEV If multiple controls are created in the same window in a single operation, it is recommended to disable the DisplayEnabled property before creating the controls and re-enable it afterwards: the display of new controls will be optimized and the effect of progressive appearance will be removed.
  • To configure the characteristics of the new control, use the properties associated with its type:
    • If the control is created directly, the indirection operator can be used to handle the control by its name:
      ControlCreate("BUTTON_1", typButton, 30, 40, 140, 20) 

      {"BUTTON_1"}..Caption = "Send an email"
      {"BUTTON_1"}..Process[trtClick] = myProcedure
    • If the created control is associated with variable of type Control, use the control properties on the variable:
      c is Control
      c <- ControlCreate("BUTTON_1", typButton, 30, 40, 140, 20) 
      c.Caption = "Click here"
      c.Process[trtClick] = myProcedure
  • To change the style of the created control:
    • WINDEV use the ChangeStyle function. Simply assign a style in the style sheet of the project to the control.
    • use the Style property. This property copies the style of an existing control to another one.
  • To define the different processes/events associated with the control, use the Process property.
  • To delete a control created by ControlCreate, use ControlDelete.
Business / UI classification: UI Code
Component: wd290obj.dll
Minimum version required
  • Version 19
This page is also available for…
Criando vários checkbox usando Loop e ControlCreate
x is int = 0
gRadio is Control
gRadio <- ControlCreate("Radio_0"+x,typCheckBox,572,80 * x ,100,56)
IF x = 1
gRadio..Caption = "Abacaxi"
gRadio..Value = 1 // marcado
ELSE IF x = 2
gRadio..Caption = "Limão"
ELSE IF x = 3
gRadio..Caption = "Laranja"
05 Jul. 2019
ControlCreate with Repositionable Notes
Hi, it's easy to create a repositionable note using ControlCreate, but it's impossible to create a button on that repositionable note! The same goes with the Repositionable Note Control - one can't place a button on it.
13 Oct. 2017
ControlCreate - Vamos Criar um Bloco de Notas
bloco_notas is Control
bloco_notas <- ControlCreate("bloco_notas_1",typRepositionableNote)


// Blog com Video e exemplo

De matos
21 Feb. 2017

Last update: 02/28/2024

Send a report | Local help