FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour How to switch Row-Colors in xBrowse (without Function)
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
How to switch Row-Colors in xBrowse (without Function)
Posted: Wed Mar 26, 2008 01:43 PM
Hello

There is a easy way to switch row colors
without any function

// Define alternating row colors 

// Col 1
// ------
oLbx1:aCols[ 1 ]:bClrStd := ;
{|| IIF( AT(".0",  STR( oLbx1:nArrayAt / 2 ) ) > 0, ;
                        {CLR_BLACK, COLOR1}, {CLR_BLACK, COLOR2} ) }

// Col 2
// ------
oLbx1:aCols[ 2 ]:bClrStd := ;
{|| IIF( AT(".0",  STR( oLbx1:nArrayAt / 2 ) ) > 0, ;
                        {CLR_BLACK, COLOR1}, {CLR_BLACK, COLOR2} ) }


Regards

Uwe[/code]
Since 1995 ( the first release of FW 1.9 )

i work with FW.

If you have any questions about special functions, maybe i can help.
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
How to switch Row-Colors in xBrowse (without Function)
Posted: Wed Mar 26, 2008 02:15 PM
Mr ukoenig

It is necessary for us to create a codeblock.

1. It is not necessary to assign bClrStd for each column. It is enough if we assign the codeblock to oBrw:bClrStd. By default, all columns inherit oBrw:bClrStd.

2. Also there is a way which applies to RDD, RecSet, Array or any data source.

The code is :
oBrw:bClrStd := { || If(  Eval( oBrw:bKeyNo, nil, oBrw ) % 2 == 0, { CLR_BLACK, COLOR1 }, { CLR_BLACK, COLOR2} ) }


This one line of code is enough for all columns and for any datasource, bet it a DBF, Array, RecordSet or whatever.
Regards



G. N. Rao.

Hyderabad, India

Continue the discussion