PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | English EN
This content has been translated automatically. Click here to view the French version.
  • Overview
  • Programming in WLanguage
  • Passing parameters to a control template
  • Example: File picker created via a control template
  • Retrieving the default value of the file picker
  • Transmitting the value entered in the control template
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Handling a Control Template control by programming
Overview
The "Control template" control is used to display an existing control template. Several operations can be performed on the "Control Template" control by programming.
Programming in WLanguage

Passing parameters to a control template

To pass parameters to a control template, we recommend that you:
  1. Create an initialization procedure in the control template.
  2. Call this procedure in the window that contains the "Control Template" control.
Example:
// -- Initialization code of Window1
// TPLC_MyControlTemplate is a control of Window1
// that is linked to a control template
// This control template contains a procedure Init()
TPLC_MyControlTemplate.Init(Param1, Param2)
Example: File picker created via a control template

Retrieving the default value of the file picker

To retrieve in the control template the default value of the file picker:
  1. In the initialization of the host window for example, initialize the value of the control template:
    TPLC_ControlTemplate1 = "C:\temp"
  2. In the "Assign Property Value" code of the field template, for example, retrieve the value and assign this value to the edit control of the selector:
    EDT_DirEdit = MySelf.Value

Transmitting the value entered in the control template

To transmit the value entered by the user to the host window:
  1. In the "Retrieve Property Value" code of the template field, enter:
    MySelf = EDT_DirEdit..Value
  2. In the host window, all you have to do is retrieve the value of the Control Template control:
    Info(TPLC_ControlTemplate1.Value)
See also
Minimum version required
  • Version 12
This page is also available for…
Comments
Click [Add] to post a comment