Hi,
Is there any way to have a 2 colours one for each line in tcbrowse with / wihtou lcellstyle
Antonio
...
::oBrw:bBkColor := {|nRow,nCol,nStyle| TcBrwCol (nRow,nStyle,::oBrw, aColorK) }
...
FUNCTION TcBrwCol ( nRow, nStyle, oBrw, aColor )
LOCAL nColor
DEFAULT aColor := {RGB( 102, 205, 170 ),RGB( 32, 178, 170 )}
//IF nStyle = 0
IF IsEven( nRow )
nColor := aColor[1]
ELSE
nColor := aColor[2]
ENDIF
//ENDIF
RETURN ( nColor )
FUNCTION IsEven( nVal )
RETURN IIF( nVal = Round( nVal/2, 0 )*2, .T., .F. )
// Purpose : Sample TCBrowse with alternating color rows
// Author : James Bott
// Date : 1/9/2008
#include "fivewin.ch"
#include "TCBrowse.ch" // <-- Important
function main()
local oWnd, oCustomer, oBrw, lClrFlag
use customer
database oCustomer
define window oWnd title "TCBrowse Test"
@ 0,0 browse oBrw of oWnd update
oBrw:setoDBF( oCustomer )
oBrw:cAlias := oCustomer:cAlias // required
add column to browse oBrw field first
add column to browse oBrw field last
lClrFlag:=.f.
oBrw:bSkip:={| nRecs | (nRecs:= oCustomer:skipper( nRecs ), lClrFlag:=if(nRecs/2 = int(nRecs/2), lClrFlag,!lClrFlag), nRecs) }
oBrw:nClrPane := { || if(lClrFlag, rgb(255,255,235), rgb(192,208,179)) }
oWnd:oClient:=oBrw
activate window oWnd
return nil
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: No registered users and 57 guests