- Overview of Static control
- Control in a window, in a page (static or dynamic) or in a report
- Creating a Static control
- Create a Static control in a window or in a report
- Create an control of type Label in RTF format in a window
- Creating a Static control in a page
- Handling a Static control
- Enter the text of the Static control
- Content of Static control (report editor)
Overview of Static control
Control in a window, in a page (static or dynamic) or in a report
A Static 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:
- The control style, by configuring the "Shadow" element.
- The "RTF" type to display a text in RTF.
- A specific animation (scroll or blink).
- Static 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 control in the "Style" tab of the control description window. You can:
- set up the control framework. For example, this option allows you to display an image in a Static control.
The icon (to the right of the "Border" option) allows you to configure the shadow of the border. When the shadow is activated, it is possible to choose the X and Y offset of the shadow, the opacity percentage, the blur radius, the Color of the shadow.
- set the characteristics of the font used via the button. It is possible to indicate:
- line spacing,
- character spacing,
New in version 28 the angle corresponding to the orientation of the text.
Creating a Static control
Create an control of type Label in RTF format in a window
To create an RTF Static control in a window:
- On the "Creation" tab, in the "Usual controls" group, click .
- Open the control description window (select "Description" in the context menu).
- In the "General" tab:
- Select the type of Static control: "RTF".
- Enter the RTF text: a specific toolbar is automatically displayed, allowing you to format the text.
- You can also create an RTF Static control via the "RTF text" Smart control.
- An RTF Static control can also be created by pasting RTF text directly in the window.
- To use a Static 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 control through programming.
Creating a Static control in a page
To create a Static control in a page:
- On the "Creation" tab, in the "Usual controls" group, expand "Text" and select "Simple static".
- Click where you want to create the control in the page. The control appears in the editor.
To view the characteristics of the control, select "Description" in the context menu.
Handling a Static control
Enter the text of the Static control
To enter the text of the Static control:
- Click the Static control in the editor. The input cursor is displayed.
- Type the text of the Static control.
For RTF Static controls (in a window or report), the format of each element can be defined via a toolbar.
Remark: The text of the Static control can also be edited in the control description window.
- The content of a Static control can be typed in the editor or defined through programming.
- A Static control can be bound to an item in a data file. In this case, the control is used to view the content of the items in the data file.
- To display numeric data (amount, date, time, etc.), use the formatted display control: the data will be displayed according to the selected input mask.
- To define an anchor on a Static control:
- Open the control description window.
- In the "UI" tab, select "Define as anchor".
- In the windows, Static 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.
Unit examples (WINDEV): The Static control
Unit examples (WINDEV): Management of RTF
Unit examples (WEBDEV): HTMLClass property
Sample components (WEBDEV): WW_CloudTags
This page is also available for…