PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
  • Content of Static control
  • Equivalence
  • Caption associated with an Image control
  • Caption associated with a button
  • Limits
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, ..Caption is used to:
  • Find out the caption associated with a file item.
    Note: The item was created in the data model editor or by programming.
  • Find out the caption associated with a data file.
    Note: 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, ..Caption is used to find out or modify 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 in a page, ..Caption is 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 Queries
// 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 = "Dear Sir" + Customer.Name
// Equivalent to: STC_IntroControl..Caption = "Dear Sir [%Customer.Name%]"
Syntax

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

<Result> = <Element name>..Caption
<Result>: Character string
Text displayed in the specified element.
<Element name>: Character string (with or without quotes)
Name of element to use.

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

<Element name>..Caption = <New text>
<Element name>: Character string (with or without quotes)
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>%] into the control caption.
  • In programming: two syntaxes are available with ..Caption:
    • use [%<Control name>%] or [%<Item name>%] in the string corresponding to the caption. For example:
      STC_IntroControl..Caption = "Dear Sir [%Customer.Name%]"
    • use the name of the control or the name of the item in the caption. For example:
      STC_IntroControl..Caption = "Dear Sir" + Customer.Name

Equivalence

..Caption is equivalent to ..Value.
To retrieve the text of a Static control, the following syntaxes are equivalent:
ResCaption = <Name of Static control>..Caption

ResCaption = <Name of Static control>..Value

ResCaption = <Name of 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>
Reports and Queries

Caption associated with an Image control

..Caption returns or replaces the current image by the image whose name is passed in parameter.
..Caption is equivalent to a direct assignment of the control with the name of the image (Control = Image_Name).
The Image control includes a caption: therefore, ..Caption is used to modify this caption. If the new caption does not correspond to a valid image, the caption of the Image control is modified.
Reports and Queries

Caption associated with a button

..Caption can have two actions:
  • replace the image of the button (the name passed in parameter corresponds to an image file),
  • return or replace the caption associated with the button (the text passed in parameter does not correspond to an image file).
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"
Note: If the specified control contains the & character, the letter that follows the & character is considered as being the shortcut of the control.

Limits

Reports and Queries In a report, ..Caption only applies to the "Static" controls and to the "Link" controls.
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