PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | English EN
  • Content of Static control
  • Equivalence
  • Caption associated with a window or with a page
  • Text of a Static, Edit, Combo Box, List Box or ListView control
  • Text of with a table column
  • Text of a Check Box or Radio Button control
  • Caption of a Check Box column in a Treeview Table control
  • Caption associated with an Image control
  • Caption associated with a button
  • Caption of a Tab control
  • Text of a Breadcrumb control
  • Limitations
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
In a database, the Caption property is used to:
  • Find out the caption associated with a file item.
    Remark: The item was created in the data model editor or by programming.
  • Find out the caption associated with a data file.
    Remark: The data file may have been created in the data model editor or by programming.
  • Find out and modify the connection caption. The connection can correspond to:
In a report, the Caption property is used to get and change the text:
  • of a Static control.
  • of a Link control.
  • Versions 17 and later
    of a Chart control.
    New in version 17
    of a Chart control.
    of a Chart control.
In a window or page, the Caption property is also used to:
  • Find out and modify the caption of a control in a window or in a page.
  • Find out and modify the caption of a menu option.
  • Find out and modify the title of a window or page.
Reminder: The initial caption of a control, window, page or menu option is defined in the editor during the object description.
Example
Reports and QueriesJavaUser code (UMC)Ajax
// Find out the caption associated with the Customer.Title item
ResCaption = Customer.Title.Caption
// Modify the text in the "STC_IntroControl" Static control
STC_IntroControl.Caption = "Hello" + Customer.FullName
// Equivalent to: STC_IntroControl.Caption = "Hello [%Customer.FullName%]"
JavaUser code (UMC)
// Change the button caption
IF WIN_Window1.Modified = True THEN
BTN_Add.Caption = "Save"
ELSE
BTN_Add.Caption = "Close"
END
Syntax
JavaUser code (UMC)Ajax

Finding out the caption associated with an item Hide the details

<Result> = <Data file>.<Item>.Caption
<Result>: Integer
Item caption.
<Data file>: Character string (with or without quotes)
Logical name of the data file used.
<Item>: Character string (with or without quotes)
Name of the item used.

Finding out the text of caption associated with an element Hide the details

<Result> = <Element used>.Caption
<Result>: Character string
Text displayed in the specified element.
<Element used>: Type of element
Name of element to use.

Modifying the text of caption associated with an element Hide the details

<Element used>.Caption = <New text>
<Element used>: Type of element
Name of element to use.
<New text>: Character string
New text displayed in the specified element.
Remarks

Content of Static control

To retrieve the value of a control or the value of an item in a Static control:
  • In the report editor: insert [%<Control name>%] or [%<Item name>%] directly into the caption of the control.
  • In programming: there are two possible syntaxes with the Caption property:
    • use directly the [%<Control name>%] or [%<Item name>%] string in the string that corresponds to the caption. For example:
      STC_IntroControl.Caption = "Hello [%Customer.FullName%]"
    • use the name of the control or the name of the item in the caption. For example:
      STC_IntroControl.Caption = "Hello" + Customer.FullName

Equivalence

The Caption and Value properties are equivalent.
To retrieve the text of a Static control, the following syntaxes are equivalent:
ResCaption = <Static control>.Caption

ResCaption = <Static control>.Value

ResCaption = <Static control>
To modify the text displayed in a Static control, the following syntaxes are equivalent:
<Name of Static control>.Caption = <New text>

<Name of Static control>.Value = <New text>

<Name of Static control> = <New text>
JavaUser code (UMC)PHPAjax

Caption associated with a window or with a page

The caption associated with a window or with a page corresponds to the title of the window or to the title of the page. This title is returned by the Title property.
JavaUser code (UMC)PHPAjax

Text of a Static, Edit, Combo Box, List Box or ListView control

The control caption corresponds to the text of caption.
In a Static control, this text is returned by the Value property.
JavaUser code (UMC)Ajax

Text of with a table column

The text of a table column corresponds to the column title and is returned by the Title property.
JavaUser code (UMC)Ajax

Text of a Check Box or Radio Button control

The Caption property is used to get and change:
  • the text of a Check Box or Radio Button control,
  • the text of an option in the Check Box or Radio Button control.
To modify the caption of an option found in a Check box or Radio Button control:
<Control name>[<Index>].Caption = <New caption>
For example:
RADIO_RadioButton[2].Caption = "Option number 2"
To modify the caption associated with a Check box or Radio Button control:
<Control name>.Caption = <New caption>
For example:
RADIO_RadioButton.Caption = "Age of participants"
To retrieve the caption of an option:
<Control>[Index].Caption
User code (UMC)

Caption of a Check Box column in a Treeview Table control

When used on a Check Box column in a TreeView Table control, the Caption property can be used to get and change the text displayed next to the check box.
Reports and QueriesJavaUser code (UMC)Ajax

Caption associated with an Image control

The Caption property returns or replaces the current image with the image passed as parameter.
The Caption property has the same effect as assigning the name of the image to the control (Control = Image_Name).
The Image control includes a caption: the Caption property is used to change this text. If the new caption does not correspond to a valid image, the caption of the Image control is modified.
Reports and QueriesJavaUser code (UMC)Ajax

Caption associated with a button

The Caption property can have two actions:
  • replace the image of the button (the name passed as parameter corresponds to an image file),
  • return or replace the button caption (the text passed as parameter is not an image file name).
For example:
// Modify the image of a graphic button
BTN_Button1.Caption = "Help.BMP"
 
// Modify the caption of a text button
BTN_Button1.Caption = "New caption"
Remark: If the specified control contains the & character, the letter that follows the & character is considered as being the shortcut of the control.
JavaUser code (UMC)

Caption of a Tab control

The caption of a Tab control corresponds to the text of the button that is used to select the tab pane.
Ajax

Text of a Breadcrumb control

The Caption property is used to:
  • get and change the text used to identify an element in the breadcrumbs. This caption was defined:
    • in the page editor, when describing the control.
    • by programming, when adding, inserting or modifying an element (BreadcrumbAddLink, BreadcrumbInsertLink, BreadcrumbModifyLink).
      For example, if the Breadcrumb control contains "Photos >> Digital", the Caption property can be used to get and change each element in the breadcrumbs:
      SMP_MyBreadcrumb[1].Caption = "Photographs"
  • get the full content of the breadcrumbs. For example:
    SMP_MyBreadcrumb.Caption = "Photographs >>Digital"

Limitations

Reports and Queries In a report, the Caption property can only be used on "Static" and "Link" controls.
Java The Caption property applies only to the following elements:
  • Button.
  • Static.
  • Edit control.
  • Image.
  • Check Box.
  • Radio Button.
  • List Box.
  • Combo Box.
  • TreeView.
  • Tab.
  • Window.
  • Table.
  • Table column.
Minimum version required
  • Version 9
This page is also available for…
Comments
Exemplo Relatorio - Alterar Caption
Exemplo Relatorio - Alterar Caption


HReadSeek(empresa,id_empresa,gnEmpresacodigo)

IF empresa.cnpj<>"" THEN
STC_cnpj_cpf..Caption="Cnpj"
STC_EMP_CGC=empresa.cnpj
ELSE
STC_cnpj_cpf..Caption="Cpf"
STC_EMP_CGC=empresa.cpf

END

//Blog com Video e Exemplo

http://windevdesenvolvimento.blogspot.com.br/2016/10/aula-946-windev-curso-relatorio-31.html

https://www.youtube.com/watch?v=G3e59Zvu_fw

De matos
20 Oct. 2016