- Initializing a Static control
- Retrieving the value of a Static control
- Advanced use of Static controls (Browser code)
- Tip: getting or setting the value of a Static control
- Properties specific to the management of a Static control
Handling a Static control programmatically
WINDEV, WINDEV Mobile and WEBDEV allow you to handle a Static control programmatically. To do so, use the variable of the Static control in the code.
The variable of the Static control corresponds to the name of the static . A Static control always is a Text control.
Initializing a Static control
To initialize a Static control, all you have to do is assign the variable of the Static control.
// Assign the last and first names read in the Customer data file to a Static control
STC_MyStatic = Customer.LastName + " " + Customer.FirstName
Retrieving the value of a Static control
To retrieve the content of a Static control:
- perform a simple assignment. For example:
CurrentStaticContent = STC_STATIC1
- use the Static control directly. For example:
- use the Value or Caption properties.
Advanced use of Static controls (Browser code)
Tip: getting or setting the value of a Static control
You can get or set the value of a Static control in browser code with JSProperty
// -- Click code (browser) of BTN_MODIF button
JSProperty("tz" + "STCBRWMOD", "innerHTML") = "Static caption, this static was modified"
Remark: The "tz" string is used to identify the Static control.
Properties specific to the management of a Static control
The following properties are used to manage the characteristics of a Static control through programming.
|Animation||Used to find out the current status of the animation in a Static control and to start/stop an animation in an animated Static control.|
|InitialAnimation||Used to find out the initial status of the animation in a Static control.|
|Ellipsis||Used to find out and modify the management mode of the ellipsis in a Static control.|
|Caption||Used to find out and modify the caption of the control.|
|FontMinSize||Used to find out and modify the minimum font size used in a Static control with the option "Reduce font". |
|BottomIndent||Used to find out and modify the bottom margin of a Static control.|
|RightIndent||Used to find out and modify the right margin of a Static control.|
|LeftIndent||Used to find out and modify the left margin of a Static control.|
|TopIndent||Used to find out and modify the top margin of a Static control.|
|RichEdit||Used to find out and modify the RTF characteristic (Rich Text Format) of a Static control.|
For a complete list of WLanguage properties that can be used with a Static control, see Properties associated with a Static control
This page is also available for…