|
|
|
|
- Overview
- Programming in WLanguage
- Passing parameters to a control template
- Example: File picker created via a control template
- Getting the default value of the file picker
- Transmitting the value entered in the control template
Handling a Control Template control through programming
The "Control template" control is used to display an existing control template. Several operations can be performed on the "Control Template" control by programming. Passing parameters to a control template To pass parameters to a control template, we recommend that you: - Create an initialization procedure in the control template.
- 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 Getting the default value of the file picker To retrieve in the control template the default value of the file picker: - In the initialization of the host window for example, initialize the value of the control template:
TPLC_ControlTemplate1 = "C:\temp"
- In the "Set the Value property" event of the control template, retrieve the value and assign it to the Edit control of the file picker:
EDT_DirEdit = MySelf.Value
Transmitting the value entered in the control template To transmit the value entered by the user to the host window: - In the "Get the Value property" event of the control template, enter:
MySelf = EDT_DirEdit.Value
- In the host window, all you have to do is retrieve the value of the Control Template control:
Info(TPLC_ControlTemplate1.Value)
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|