PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Overview
  • Modifying the text color
  • Modifying the background color
  • Differences between browsing Table control and memory Table 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
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:
Versions 22 and later
Note: You have the ability to definer the border of cells and its color via ..Border.
New in version 22
Note: You have the ability to definer the border of cells and its color via ..Border.
Note: You have the ability to definer the border of cells and its color via ..Border.
Versions 20 and later
Android The Table control is now available for the Android applications.
iPhone/iPad The Table control is now available for the iPhone/iPad applications.
New in version 20
Android The Table control is now available for the Android applications.
iPhone/iPad The Table control is now available for the iPhone/iPad applications.
Android The Table control is now available for the Android applications.
iPhone/iPad The Table control is now available for the iPhone/iPad applications.
Modifying the text color
To modify the text color:
  • for all columns of a Table control:
    <Name of Table Control>..Color = <Color Value>
  • for a column:
    <Name of Table Control>..Color = <Color Value>
  • for a row of the Table control:
    <Name of Table Control>[<Row>]..Color = <Color Value>

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

    <Column Name>[<Row>][<Column>]..Color = <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: DefaultColor 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..Color = LightYellow
// Use the RGB components
TABLE_Table1..Color = RGB(10,0,90)

// Table control with yellow background for the NAME column
COL_NAME..Color = LightYellow
// Use the RGB components
COL_NAME..Color = RGB(10,0,90)
// Cancel the colors
COL_NAME..Color = DefaultColor

// Write the text displayed in a row in red
// TABLE_Table1[TABLE_Table1] returns the subscript of the row currently displayed
IF COL_Amount > 10 THEN
TABLE_Table1[TABLE_Table1]..Color = LightRed
END
// Cancel the colors
TABLE_Table1[TABLE_Table1]..Color = DefaultColor

// Table control with a cell whose text is dark blue
TABLE_Table1[10][2]..Color = DarkBlue
// Cancel the colors
TABLE_Table1[10][2]..Color = DefaultColor
Modifying the background color
To modify the background color:
  • for all the columns of a Table control:
    <Name of Table Control>..BrushColor = <Color Value>
  • for a column:
    <Column Name>..BrushColor = <Color Value>
  • for a row of a Table control:
    <Name of Table Control>[<Row>]..BrushColor = <Color Value>

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

    <Column Name>[<Row>][<Column>]..BrushColor = <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..BrushColor = LightYellow
// Use the RGB components
TABLE_Table1..BrushColor = RGB(10,0,90)

// Table control with yellow background for the COL_NAME column
COL_NAME..BrushColor = LightYellow
// Use the RGB components
COL_NAME..BrushColor = RGB(10,0,90)
// Cancel the colors
COL_NAME..BrushColor = DefaultColor

// Display a row in red
// TABLE_Table1[TABLE_Table1] returns the subscript of the row currently displayed
IF COL_Amount > 10 THEN
TABLE_Table1[TABLE_Table1]..BrushColor = LightRed
END
// Cancel the colors
TABLE_Table1[TABLE_Table1]..BrushColor = DefaultColor

// Table control with a cell whose background color is dark blue
TABLE_Table1[10][2]..BrushColor = DarkBlue
// Cancel the colors
TABLE_Table1[10][2]..BrushColor = DefaultColor
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 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
IF AMOUNT > 10 THEN
        TABLE_Table1[TABLE_Table1][2]..Color = LightRed
        // AMOUNT column is #2
END
Minimum required version
  • Version 9
This page is also available for…
Comments
Exemplo Cores Tabela
Exemplo Cores Tabela

//Blog com Video E Exemplo
http://windevdesenvolvimento.blogspot.com.br/2016/09/aula-926-curso-windev-tabela-032-tabela.html

https://www.youtube.com/watch?v=6XWstwl1WQA

De matos
Sep. 30 2016