PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
  • Overview
  • Retrieving and modifying the caption of the Button control
  • Retrieving the caption
  • Modifying the caption
  • Finding out and modifying the status of an On/Off button
  • Changing the target of a Button control
  • To use a simple target (frame of the frameset for example) in most cases and a new browser in some cases:
  • To open a browser in most cases and to use a specific destination in some cases:
  • Modifying the image displayed in the Button control
  • To change the image of a Button control in browser code
  • Properties specific to the management of images in a Button 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 Button control by programming
Overview
WINDEV, WINDEV Mobile and WEBDEV allow you to handle a Button control by programming. To do so, use the variable of the Button control in the code.
The variable of the Button control:
  • corresponds to the name of the Button control.
  • is initialized with the caption of the Button control.
Retrieving and modifying the caption of the Button control

Retrieving the caption

To retrieve the caption of the Button control, use the following syntax:
  • direct syntax:
    <Caption> = <Name of Button control>
  • using ..Caption:
    <Caption> = <Name of Button control>..Caption
<Caption> is Character String variable.

Modifying the caption

To modify the caption of the Button control, use the following syntax:
<Name of Button control> = <Caption>
<Caption> is Character String variable.
Finding out and modifying the status of an On/Off button
Changing the target of a Button control
WEBDEV - Server code The target of a Button control is defined in the page editor at the same time as the action to perform (in the description window of the Button control). See Action associated with the Button control for more details.
WEBDEV gives you the ability to modify this target by programming. Indeed, in some sites, the target of a Button control can be modified according to the action performed by the Web user.
Example: if the Web user types his name and password:
  • if the password is correct, the application continues in the current page
  • if the password is incorrect, a new browser is opened to ask for the name and password again.
In this example, in most cases, the Web user will enter a correct password. The error is an exception.
WEBDEV - Server code

To use a simple target (frame of the frameset for example) in most cases and a new browser in some cases:

  1. In the Button control description, define the "simple" target (frame of the frameset, current browser, etc.).
  2. In the browser code of the Button control, use ChangeTarget:
    IF <Condition> THEN
    // Change the target
    // Display in a new browser
    ChangeTarget(NewBrowser, "New")
    END
WEBDEV - Server code

To open a browser in most cases and to use a specific destination in some cases:

  1. In the Button control description, define the "New browser" target by defining the parameters of the new browser.
  2. In the browser code of the Button control, use ChangeTarget:
    IF <Condition> THEN
    // Change the target
    // Display in the "FRM_Target" frame
    ChangeTarget(FRM_Target)
    END
Modifying the image displayed in the Button control
WEBDEV - Browser code

To change the image of a Button control in browser code

  1. Save the new image in the "<ProjectName>_WEB" directory.
  2. Use FolderWeb. For example:
    BTN_IMAGE = FolderWeb() + "/VSXP15022_MODIF.gif"
Properties specific to the management of images in a Button control
The following properties are used to manage the images used in a Button control by programming.
PushedAllows you to find out and modify the status of an on/off Button control (pressed or not).
ImageAllows you to find out and modify the image of a Button control.
ImageStateAllows you to find out and modify the number of drawings found in the image associated with a Button control.
BackgroundImageAllows you to find out and modify the image associated with the border of a Button control.
BackgroundImageStateAllows you to find out and modify the number of drawings found in the image associated with the border of a Button control.
ValueAllows you to find out and modify the caption of a Button control.

To find out the entire list of WLanguage properties that can be used with a Button control, see Properties associated with the Button control.
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment