PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | English EN
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Creates a new control (of any type) in a window through programming.
Versions 23 and later
iPhone/iPad This function is now available for iPhone/iPad applications.
New in version 23
iPhone/iPad This function is now available for iPhone/iPad applications.
iPhone/iPad This function is now available for iPhone/iPad applications.
Example
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")
Syntax
<Result> = ControlCreate(<Name> , <Type> [, <X> [, <Y> [, <Width> [, <Height> [, <Visible>]]]]])
<Result>: Control variable
The created control can be handled by a Control variable. 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)
  • Versions 24 and later
    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
    New in version 24
    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
    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
iPhone/iPadIOS WidgetMac Catalyst Not available.
typOrganizerOrganizer control
iPhone/iPadIOS WidgetMac Catalyst Not available.
typScrollbarScrollbar control
iPhone/iPadIOS WidgetMac Catalyst Not available.
typToolbarToolbar control
iPhone/iPadIOS WidgetMac Catalyst Not available.
typToolboxSidebar control
iPhone/iPadIOS WidgetMac Catalyst Not available.
typButtonButton control
typCalendarCalendar control
typCarouselCarousel control
iPhone/iPadIOS WidgetMac Catalyst Not available.
Versions 20 and later
typMap
New in version 20
typMap
typMap
Map control
typClickClickable Image control
typBarCodeBar Code control
typColumnTable Column control
typComboWEEditable Combo Box control
typComboNENon-editable Combo Box control
Versions 22 and later
typConference
New in version 22
typConference
typConference
Conference control
Versions 23 and later
typNativeContainer
New in version 23
typNativeContainer
typNativeContainer
Native Container control
typCubeCube control
iPhone/iPadIOS WidgetMac Catalyst Not available.
typDateDate edit control
typDurationDuration edit control
iPhone/iPadIOS WidgetMac Catalyst Not available.
Versions 23 and later
typImageEditor
New in version 23
typImageEditor
typImageEditor
Image Editor control
iPhone/iPadIOS WidgetMac Catalyst Not available.
Versions 26 and later
typHtmlEditor
New in version 26
typHtmlEditor
typHtmlEditor
HTML Editor control
IOS WidgetMac Catalyst Not available.
typInternalWindowInternal Window control
Versions 21 and later
typWire
New in version 21
typWire
typWire
Wire control
iPhone/iPadIOS WidgetMac Catalyst Not available.
typShapeShape/Drawing control
iPhone/iPadIOS WidgetMac Catalyst Not available.
typGanttGantt Chart column
iPhone/iPadIOS WidgetMac Catalyst Not available.
typChartChart control
typTimeTime edit control
typHTMLHTML Display control
typImageImage control
typCheckBoxCheck Box control
Versions 24 and later
typSwitch
New in version 24
typSwitch
typSwitch
Switch control
typProgressBarProgress Bar control
Versions 20 and later
typInfiniteProgressBar
New in version 20
typInfiniteProgressBar
typInfiniteProgressBar
Infinite Progress Bar control
Versions 23 and later
typPDFReader
New in version 23
typPDFReader
typPDFReader
PDF Reader control
typStaticStatic control
typListList Box control
typListViewListView control
iPhone/iPadIOS WidgetMac Catalyst Not available.
typCurrencyCurrency edit control
typMultimediaMultimedia control
typRatingRating control
Versions 21 and later
typRepositionableNote
New in version 21
typRepositionableNote
typRepositionableNote
Repositionable Note control
iPhone/iPadIOS WidgetMac Catalyst Not available.
typNumNumeric edit control
typOleOLE control
iPhone/iPadIOS WidgetMac Catalyst Not available.
typTabTab control
typOrganizationChartOrganization Chart control
iPhone/iPadIOS WidgetMac Catalyst Not available.
Versions 24 and later
typPanel
New in version 24
typPanel
typPanel
Dockable Panel control
iPhone/iPadIOS WidgetMac Catalyst Not available.
typSchedulerScheduler control
typSliderSlider control
typRotativeSliderRound Slider control
Versions 24 and later
typRangeSlider
New in version 24
typRangeSlider
typRangeSlider
Range Slider control
typRibbonRibbon control
iPhone/iPadIOS WidgetMac Catalyst Not available.
typSelectRadio Button control
typSplitterSplitter control
iPhone/iPadIOS WidgetMac Catalyst Not available.
typSpinSpin control
iPhone/iPadIOS WidgetMac Catalyst Not available.
typSuperControlSupercontrol
typTableTable control
typPivotTablePivot Table control
iPhone/iPadIOS WidgetMac Catalyst Not available.
Versions 19 and later
typDashboard
New in version 19
typDashboard
typDashboard
Dashboard control
typTreeviewTableTreeView Table control
iPhone/iPadIOS WidgetMac Catalyst Not available.
Versions 20 and later
typSpreadsheet
New in version 20
typSpreadsheet
typSpreadsheet
Spreadsheet control
iPhone/iPadIOS WidgetMac Catalyst Not available.
typTextText edit control
typDrawerDrawer control
iPhone/iPadIOS WidgetMac Catalyst Not available.
Versions 22 and later
typWordProcessing
New in version 22
typWordProcessing
typWordProcessing
Word Processing control
iPhone/iPadIOS WidgetMac Catalyst Not available.
typTreeMapTreeMap control
iPhone/iPadIOS WidgetMac Catalyst Not available.
typTreeViewTreeView control
typTabPaneTab Pane control
typWebCamWeb Camera control
typXamlXaml control
iPhone/iPadIOS WidgetMac Catalyst Not available.
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.
Remarks
  • 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 a Control variable, all you have to do is 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.
    • Versions 20 and later
      use the Style property. This property copies the style of an existing control to another one.
      New in version 20
      use the Style property. This property copies the style of an existing control to another one.
      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: wd270obj.dll
Minimum version required
  • Version 19
This page is also available for…
Comments
Click [Add] to post a comment