PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Overview
  • Initializing a Static control
  • Case of HTML static controls
  • Keeping the formating in the HTML static controls
  • Retrieving the value of a Static control
  • Case of HTML static controls
  • Advanced use of static controls (browser code)
  • Tip: modifying or retrieving the value of a static control
  • Properties specific to the management of a static control
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 Static control by programming
Overview
WINDEV, WINDEV Mobile and WEBDEV allow you to handle a Static control by programming. 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.
For example:
// Assign the last and first names read in CUSTOMER file to a Static control
STC_MyStatic = Customer.LastName + "  " + Customer.FirstName
WEBDEV - Server code

Case of HTML static controls

To initialize an HTML static control, you have the ability to initialize the control with the HTML code. This allows you to format the HTML static control by programming.
For example:
// Modify the caption
HTMSTC_MODIFIABLE..Caption = "This section was " + ...
"modified
"
WEBDEV - Server code

Keeping the formating in the HTML static controls

By default, the formatting is not kept when modifying the caption displayed in an HTML static control.
To keep the formatting when modifying the Static control:
  1. Type and format the initial caption of the control (in the description window).
  2. Replace the words in the static control to modify by the "%<Number>" expression. The "Number" parameter is used to identify the word to modify. The first word will correspond to number 1, the second one to number 2, ...
  3. Build the new static with StringBuild.
// -- Initialization code of "MyHTMLStatic" control
MyDate is string
MyDate = DateToString(DateSys())
MyTime is string
MyTime = TimeToString(TimeSys())
HTMSTC_MyHTMLStatic = StringBuild(HTMSTC_MyHTMLStatic, MyDate, MyTime)
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:
    Info(STC_STATIC1)
  • use ..Value or ..Caption.
WEBDEV - Server code

Case of HTML static controls

When retrieving the content of an HTML static control, the text retrieved corresponds to the HTML code of the static control.
Advanced use of static controls (browser code)
WEBDEV - Server code

Tip: modifying or retrieving the value of a static control

You have the ability to retrieve or modify the value of a static control in browser code with JSProperty.
Reminder: This option is reserved to the developers who are familiar with JavaScript.
Example:
// -- Click code (browser) of BTN_MODIF button
JSProperty("tz" + "STCBRWMOD", "innerHTML") = "Static caption, this static was modified"
Note: 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 by programming.
AnimationUsed to find out the current status of the animation in a Static control and to start/stop an animation in an animated Static control.
InitialAnimationUsed to find out the initial status of the animation in a Static control.
EllipseUsed to find out and modify the management mode of ellipsis in a Static control.
CaptionUsed to find out and modify the caption of the control.
Versions 22 and later
BottomIndent
New in version 22
BottomIndent
BottomIndent
Used to find out and modify the bottom margin of a Static control.
Versions 22 and later
RightIndent
New in version 22
RightIndent
RightIndent
Used to find out and modify the right margin of a Static control.
Versions 22 and later
LeftIndent
New in version 22
LeftIndent
LeftIndent
Used to find out and modify the left margin of a Static control.
Versions 22 and later
TopIndent
New in version 22
TopIndent
TopIndent
Used to find out and modify the top margin of a Static control.
RichEditUsed to find out and modify the RTF characteristic (Rich Text Format) of a Static control.
To find out the entire list of WLanguage properties that can be used with a Static control, see Properties associated with a Static control.
Minimum required version
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment