PC SOFT

WINDEV的在线文档

  • Overview
  • Modifying the color of the text
  • Modifying the background color
  • Differences between browsing Table control and memory Table control
文档页面当前正在翻译。对于此延迟我们深表歉意。
您可以自愿地帮助我们翻译您想要的文档段落,然后只需通过以下地址与我们联系: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本地访问

Overview
The colors of a Table control (row background, text of rows) are defined in the description window of the control. They can be modified by programming with the following properties:

Modifying the color of the text
To modify the color of the text:
  • for all the columns of a Table control:
    <Name of Table Control>..颜色 = <Color Value>
  • for a column:
    <Name of Table Control>..颜色 = <Color Value>
  • for a row of the Table control:
    <Name of Table Control>[<Row>]..颜色 = <Color Value>

    <Column Name>[<Row>]..颜色 = <Color Value>
  • for a cell of the Table control:
    <Name of Table Control>[<Row>][<Column>]..颜色 = <Color Value>

    <Column Name>[<Row>][<Column>]..颜色 = <Color Value>
In these syntaxes:
  • <Name of Table Control>:
    Character string containing the name of the Table control.
  • <Column Name>:
    Character string containing the name of the column.
  • <Row>:
    Integer used to identify the row to modify. There is no need to specify this parameter if the row to modify is the current row.
  • <Column>:
    Integer corresponding to the number of the column for the cell to modify. The numbering of columns includes all the columns, even the invisible or inactive columns. The first column (on the left) is column #1, the second one is column #2 ...
  • <Color Value>:
    Integer containing the value of the color. This value can correspond to:
Note: 颜色默认 cannot be used to cancel the change of color for the entire Table control. Indeed, changing the color of the Table control consists in modifying the style of the control, the new color becomes the default color.
To modify the color of a Table control then to go back to the previous color, the color must be modified row by row or column by column.

Examples:

// Table control: Yellow text
TABLE_Table1..颜色=浅黄色
// Use the RGB components
TABLE_Table1..颜色=RGB10090

// Table control with yellow background for the NAME column
COL_NAME..颜色=浅黄色
// Use the RGB components
COL_NAME..颜色=RGB10090
// Cancel the colors
COL_NAME..颜色=颜色默认

// Write the text displayed in a row in red
// TABLE_Table1[TABLE_Table1] returns the subscript of the row currently displayed
如果COL_Amount大于10,那么
TABLE_Table1TABLE_Table1】..颜色=浅红色
结束
// Cancel the colors
TABLE_Table1TABLE_Table1】..颜色=颜色默认

// Table control with a cell whose text is dark blue
TABLE_Table110】【2】..颜色=深蓝色
// Cancel the colors
TABLE_Table110】【2】..颜色=颜色默认

Modifying the background color
To modify the background color:
  • for all the columns of a Table control:
    <Name of Table Control>..背景颜色 = <Color Value>
  • for a column:
    <Column Name>..背景颜色 = <Color Value>
  • for a row of a Table control:
    <Name of Table Control>[<Row>]..背景颜色 = <Color Value>

    <Column Name>[<Row>]..背景颜色 = <Color Value>
  • for a cell of a Table control:
    <Name of Table Control>[<Row>][<Column>]..背景颜色 = <Color Value>

    <Column Name>[<Row>][<Column>]..背景颜色 = <Color Value>

In these syntaxes:

  • <Name of Table Control>:
    Character string containing the name of the Table control.
  • <Column name>:
    Character string containing the name of the column.
  • <Row>:
    Integer used to identify the row to modify. There is no need to specify this parameter if the row to modify is the current row.
  • <Column>:
    Integer corresponding to the number of the column for the cell to modify. The numbering of columns includes all the columns, even the invisible or inactive columns. The first column (on the left) is column #1, the second one is column #2...
  • <Color Value>:
    Integer containing the value of the color. This value can correspond to:
Examples:

// Table control: yellow background
TABLE_Table1..背景颜色=浅黄色
// Use the RGB components
TABLE_Table1..背景颜色=RGB10090

// Table control with yellow background for the COL_NAME column
COL_NAME..背景颜色=浅黄色
// Use the RGB components
COL_NAME..背景颜色=RGB10090
// Cancel the colors
COL_NAME..背景颜色=颜色默认

// Display a row in red
// TABLE_Table1[TABLE_Table1] returns the subscript of the row currently displayed
如果COL_Amount大于10,那么
TABLE_Table1TABLE_Table1】..背景颜色=浅红色
结束
// Cancel the colors
TABLE_Table1TABLE_Table1】..背景颜色=颜色默认

// Table control with a cell whose background color is dark blue
TABLE_Table110】【2】..背景颜色=深蓝色
// Cancel the colors
TABLE_Table110】【2】..背景颜色=颜色默认

Differences between browsing Table control and memory Table control
Memory Table control
  • The change of colors in the Table control remains active until the next change.
  • The change of color associated with for a row or with a cell is stored: when scrolling (vertically and horizontally) the content of the memory Table control, the change of color associated with the row or with the cell remains "active".
Browsing Table control
  • The change of colors in the Table control remains active until the next change of color.
  • The change of color associated with a row or with a cell is not stored: when scrolling (vertically and horizontally) the content of the browsing Table control, the change of color associated with the row or with the cell is lost when the row "exits" from the Table control.
    To store the change of color, this change must be called in the display process of a row of the Table control.
Example: display the cell in red if AMOUNT to pay >10

如果AMOUNT大于10,那么
TABLE_Table1TABLE_Table1】【2】..颜色=浅红色
// AMOUNT column is #2
结束