PC SOFT

WINDEV的在线文档

  • Overview
  • Retrieving and modifying the caption of the button
  • Retrieving the caption
  • Modifying the caption
  • Finding out and modifying the status of an On/Off button
  • Changing the target of a button
  • Modifying the image displayed in the button
  • Properties for managing the images of a button
文档页面当前正在翻译。对于此延迟我们深表歉意。
您可以自愿地帮助我们翻译您想要的文档段落,然后只需通过以下地址与我们联系:info@cn.windev.com
产品
WinDevWebDev-服务器代码WebDev-浏览器代码WinDev Mobile报表和查询
平台
WindowsLinuxWindows MobileWindows PhoneWindows Store appsAndroidAndroid Widget iPhone/iPad
语言
JavaPHPAjax用户代码(MCU)外部语言
数据库
HFSQLHFSQL Client/Server存储过程HF 5.5OLE DBODBC本地访问

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.
  • is initialized with the caption of the button.

Retrieving and modifying the caption of the button

Retrieving the caption

To retrieve the caption of the button, use the following syntax:

  • direct syntax:
    <Caption> = <Button Name>
  • using ..标签:
    <Caption> = <Button Name>..标签
<Caption> is Character String variable.

20版本和更高版本
WinDev Note: If the caption is in RTF ("RTF" checked in the "General" tab of the control description), the retrieved caption will contain the RTF tags. To get the caption without the RTF tags, use RTF转换到文本. For example:
MyCaption字符串型
MyCaptionRTF转换到文本BTN_Button..标签)
20新版本
WinDev Note: If the caption is in RTF ("RTF" checked in the "General" tab of the control description), the retrieved caption will contain the RTF tags. To get the caption without the RTF tags, use RTF转换到文本. For example:
MyCaption字符串型
MyCaptionRTF转换到文本BTN_Button..标签)
WinDev Note: If the caption is in RTF ("RTF" checked in the "General" tab of the control description), the retrieved caption will contain the RTF tags. To get the caption without the RTF tags, use RTF转换到文本. For example:
MyCaption字符串型
MyCaptionRTF转换到文本BTN_Button..标签)

Modifying the caption

To modify the caption of the button, use the following syntax:

<Button Name> = <Caption>

<Caption> is Character String variable.

20版本和更高版本
WinDev Note: If the caption is in RTF ("RTF" checked in the "General" tab of the control description), the new caption may (or may not) contain RTF text.
20新版本
WinDev Note: If the caption is in RTF ("RTF" checked in the "General" tab of the control description), the new caption may (or may not) contain RTF text.
WinDev Note: If the caption is in RTF ("RTF" checked in the "General" tab of the control description), the new caption may (or may not) contain RTF text.

Finding out and modifying the status of an On/Off button
WinDevWindows Store apps ..按下 is used to find out the status of the button:

<Status> = <Button Name>..按下

<Status> is a Boolean variable:
  • if the button is pressed,
  • if the button is released.

Changing the target of a button

Modifying the image displayed in the button
WinDevWindows Store apps To modify the image displayed in the button, use ..图片:

<Button Name>..图片 = <Image Path>

<Image Path> is a Character String variable.

Windows支持的图片格式为:
  • Bitmap (*.BMP)
  • 图形交换格式(*.gif)
  • 联合图像专家小组(*.jpg ; *.jpeg)
  • 柯达照片CD(*.pcd)
  • PaintBrush(*.pcx)
  • Adobe Photoshop格式(*.psd)
  • TrueVision TARGA(*.tga)
  • 标记图像文件格式(*.tif ; *.tiff)
    注意: 不支持tiff 6.0标准的"tiled tiff"选项。 在这种情况下,我们建议您以tiff 5.0标准储存图片。
  • Portable Network Graphics (*.png)
  • Windows元文件(*.emf ; *.wmf)
  • 图标(*.ico ; *.icw)
  • 光标(*.CUR) *.cur
  • Portable Document Format (*.pdf)
  • 15版本和更高版本
    Scalable Vector Graphics (*.svg)
    15新版本
    Scalable Vector Graphics (*.svg)
    Scalable Vector Graphics (*.svg)
注意: 若想管理pdf和svg格式,您必须为Windows 2000以及更低版本的计算机安装GDIPLUS.DLL。 对于更高的版本,该DLL由Windows默认提供。 想了解更多信息,请查阅GDI+框架

Note: To manage the images in TIFF, GIF and JPEG format, Wxxximg.dll must be installed with the other DLLs of WinDev.

Properties for managing the images of a button
The following properties are used to manage the images displayed by a button.
按下Used to find out and modify the status of an on/off button (pressed or not).
图片Used to find out and modify the image of a button.
图片状态Used to find out and modify the number of drawings found in the image associated with a button.
背景图片Used to find out and modify the image associated with the border of a button.
背景图片数量Used to find out and modify the number of drawings found in the image associated with the border of a button.
Used to find out and modify the caption of a button.

To find out the entire list of WLanguage properties that can be used with a Button control, see Properties associated with the Button control.