ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / Developing an application or website / Controls, windows and pages / Controls: Available types / Button control
  • Overview
  • Retrieving and modifying the caption of the Button control
  • Retrieving the caption
  • Changing the caption
  • Finding out and modifying the state of an On/Off button
  • Changing the target of a Button control
  • Modifying the image displayed in the Button control
  • 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/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Handling Button controls programmatically
Overview
WINDEV, WINDEV Mobile and WEBDEV allow you to programmatically handle Button controls. 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> = <Button control>
  • using the Caption property:
    <Caption> = <Button control>.Caption
<Caption> is Character String variable.

Changing the caption

To modify the caption of the Button control, use the following syntax:
<Button control> = <Caption>
<Caption> is Character String variable.
Finding out and modifying the state of an On/Off button
Universal Windows 10 AppAndroid The Pushed property is used to get the state of the Button control:
<State> = <Button control>.Pushed
<State> is a Boolean variable:
  • True if the button is pressed,
  • False if the button is released.
Changing the target of a Button control
Modifying the image displayed in the Button control
Universal Windows 10 AppAndroidiPhone/iPad To change the image displayed in the Button control, use the Image property:
<Button control>.Image = <Image path>
<Image path> is a Character String variable
The following image formats are supported in Windows:
  • Bitmap (*.BMP)
  • Graphics Interchange Format (*.gif)
  • Joint Picture Experts Group (*.jpg ; *.jpeg)
  • Kodak Photo CD (*.pcd)
  • PaintBrush (*.pcx)
  • Adobe Photoshop Format (*.psd)
  • TrueVision TARGA (*.tga)
  • Tagged Image File Format (*.tif ; *.tiff)
    Remark: the "tiled tiff" option of tiff 6.0 standard is not supported. In this case, we advise you to save the image in tiff 5.0 standard.
  • Portable Network Graphics (*.png)
  • Windows MetaFiles (*.emf ; *.wmf)
  • Icons (*.ico ; *.icw)
    Remarks:
    • HQ display (High Quality) available.
    • Management of sheets in transparent BMP format (32 bits).
  • Cursors (*.cur)
  • Portable Document Format (*.pdf)
  • Scalable Vector Graphics (*.svg)
  • WINDEV images (generated by the image editor, *.WDPIC).
Remark: To manage the images in TIFF, GIF and JPEG format, Wxxximg.dll must be installed with the other DLLs of WINDEV.
Properties specific to the management of images in a Button control
The following properties are used to programmatically handle the images used in 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.
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.
PushedAllows you to find out and modify the state of an on/off Button control (pressed or not).
ValueAllows you to find out and modify the caption of a Button control.

For a complete list of WLanguage properties that can be used with Button controls, see Button control properties.
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 04/05/2023

Send a report | Local help