ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / Developing an application or website / Controls, windows and pages / Controls: Available types / Static Text control
  • Overview of Static Text control
  • Control in a window, in a page (static or dynamic) or in a report
  • Creating a Label field in a window or page
  • Creating a Label field in a window or page
  • Management of excessively long labels
  • Special case: Label field in RTF format
  • Creating a Label control in a report
  • Creating a Label control in a report
  • Content of Static Text control
  • Enter text for the Label field in the editor
  • Content of Static Text control (report editor)
  • Notes
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Overview of Static Text control

Control in a window, in a page (static or dynamic) or in a report

A Static Text control is a control used to display a static text. The content of the control cannot be entered by the user.
To apply effects to the displayed text, you have the ability to use:
  • WINDEVAndroidAndroid Widget iPhone/iPad The control style, by configuring the "Shadow" element.
    Text with shadow
  • WINDEV The "RTF" type to display a text in RTF.
    RTF text
  • WINDEVAndroidiPhone/iPad A specific animation (scroll or blink).
    Scrolling text
    New in version 2025
    This feature is now available on Android and iOS.
WINDEVAndroidAndroid Widget iPhone/iPad Remarks:
  • Static Text controls can also be configured with a display mask to automatically apply a format to the value that is assigned to them.
  • You can configure different effects for the Static Text control in the "Style" tab of the control description window. You can:
    • configure the border of the control. For example, this option allows you to display an image in a Static Text control.
      The icon (to the right of the "Border" option) allows you to configure the shadow of the border. If a shadow is used, you can choose the X and Y offset, percentage of opacity, blur radius and shadow color.
    • set the characteristics of the font via the button. You can specify:
      • the line spacing,
      • the character spacing,
      • WINDEViPhone/iPad the text angle.
Creating a Label field in a window or page

Creating a Label field in a window or page

To create a Label field in a window or a page:
  1. On the "Creation" tab, in the "Usual controls" group, click Static.
  2. Click where the control will be created in the window or page. The control appears in the editor.
To view the characteristics of the control, select "Description" in the context menu. You can type text in the control or define the type of information that will be displayed.

Management of excessively long labels

If the wording is too long, several solutions are available:
  • WINDEVAndroidAndroid Widget iPhone/iPad Reduce font:
    It is possible to define a minimum font size for the text in case of too long labels (option "Reduce font size" in the "Detail" tab of the field description window).
  • Display an Ellipsis: you can set up an Ellipsis. The Ellipsis replaces excessively long text with three dots..
    • WEBDEV - Server codePHP In a page, the text can only be truncated at the end, by marking the end of the text with three dots.. The "Truncate with an ellipsis at the end" option is available in the "UI" tab of the field description window..
    • WINDEVAndroidAndroid Widget iPhone/iPad In a window, it is possible to propose an Ellipsis either at the end or in the middle of text that is too long.. The use of the ellipsis can be defined in the "Details" tab of the Static Text control.
    • WINDEVAndroidAndroid Widget iPhone/iPad Propose an animation: The animation can be used to dequeue the text in the text box.. In this way, the user will see the entire text during the animation.. For more details on how to set up the animation, see Animate a Label field.
      New in version 2025
      AndroidAndroid Widget iPhone/iPad Animation of labels is now available.
WINDEVJava

Special case: Label field in RTF format

To create a Static Text control in RTF in a window:
  1. On the "Creation" tab, in the "Usual controls" group, click Static.
  2. Open the control description window (select "Description" in the context menu).
  3. In the "General" tab:
    • Select field type Label: "RTF"..
    • Enter the text in RTF format: a special toolbar automatically appears to format the text.
Remarks:
  • You can also create an RTF Static Text control via the "RTF text" Smart control.
  • An RTF Static Text control can also be created by pasting RTF text directly in the window.
  • To use a Static Text control in RTF, the "RICHED20.DLL" file must be on the current computer. In most cases, the "RICHED20.DLL" file is in the Windows system directory.
  • You can also use the RichEdit property to modify the RTF type of a Static Text control programmatically.
Creating a Label control in a report
WINDEVWEBDEV - Server codeAndroidiPhone/iPad

Creating a Label control in a report

To create a Label type control in a report:
  1. On the "Creation" tab, in the "Text" group, click Static.
  2. Click where you want to create the control. The control appears in the editor.
To view the characteristics of the control, select "Description" in the context menu. You can type text in the control or define the type of information that will be displayed.
Notes: The "UI" tab in the description of the Static Text control in the report editor allows you to manage numerous options, including Ellipsis, conditional display, etc.)..
Content of Static Text control
A Label field can display information:
  • entered in the editor.
  • defined by programming.
  • from a data file. In this case, the Static Text control is linked to a field in a data file.. In this case, the control is used to view the content of the items in the data file.

Enter text for the Label field in the editor

To type the text of the Static Text control:
  1. Click the Static Text control in the editor. The input cursor is displayed.
  2. Type the text of the Static Text control.
    WINDEV For RTF Static Text controls (in a window or report), the format of each element can be defined via a toolbar.
Note: The text in the Label field can also be modified in the field description window..
WINDEVWEBDEV - Server codeAndroidAndroid Widget iPhone/iPad

Content of Static Text control (report editor)

  • The character string displayed in the Static Text control can contain the value of an item printed in the report. To insert the value of an item or a control of the report into the text of the Static Text control, enter the name of the item or control between [% and %].
    For example, the text of the control can correspond to:
    The [%SupplierName%] supplier sells the [%ProductName%] product at [%PriceIOT%].
    SupplierName, ProductName and PriceIOT will be replaced with their value when the report is executed.
  • Text can span multiple lines. In this case, the control must be a multiline control and its size must be large enough.
    Note: If an orientation angle is applied to a multiline field, automatic carriage returns are not taken into account.. Only the manual CR characters are taken into account.
Reminder: The "auto-resizing" option automatically increases the size of the field according to its content.
Notes
  • WEBDEV - Server code To display numeric data (amount, date, time, etc.), use formatted display control: data will be displayed according to the selected input mask.
  • WEBDEV - Server code To define an anchor on a Static Text control:
    1. Open the control description window.
    2. On the "UI" tab, select "Define as anchor".
    3. Validate.
  • WINDEVAndroid In the windows, Static Text controls include a display mask to automatically apply a format to the data assigned to them. This mask can be modified programmatically with the InputMask property.
Related Examples:
Management of RTF Unit examples (WINDEV): Management of RTF
[ + ] Using the main functions for RTF management in a WINDEV application:
- Load a file in RTF format
- Save a file in RTF format
- Find and select a word in an RTF text
- Display a text in RTF format
- Modify the characteristics of a selection (font, case, color, ...)
HTMLClass property Unit examples (WEBDEV): HTMLClass property
[ + ] The property ..HTMLClass allows you to read and update the control's HTML attribute "class".
This property lets you select the CSS Style applied on the control.
WW_CloudTags Sample components (WEBDEV): WW_CloudTags
[ + ] This example explains how to display a cloud of tags in a dynamic WEBDEV application.
Indeed, on Internet, a site page responds more or less to a set of keywords.
The purpose of this example is to explain how to display the keywords of a site in an area of the page by indicating the important keywords graphically.
The keywords are represented as links of different sizes: the more important the keyword is, the larger the font is.
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 09/24/2024

Send a report | Local help