I try to set color CLR_RED for columns that content 'X' but it's not working.
How can I do that? This is image of my sample code.
- Code: Select all Expand view RUN
#include 'fivewin.ch'
#include 'xbrowse.ch'
FUNCTION Main
local oWnd, oBrw
local aStatus := { {'1','','X','','X'}, ;
{'2','X','X','','X'}, ;
{'3','','','X','X'} }
local n
DEFINE WINDOW oWnd TITLE "Change columns colors"
oBrw := TXBrowse():New( oWnd )
oBrw:nMarqueeStyle := MARQSTYLE_HIGHLCELL
oBrw:nColDividerStyle := LINESTYLE_BLACK
oBrw:nRowDividerStyle := LINESTYLE_BLACK
oBrw:nFreeze := 1
oBrw:bLDblClick := {|nRow,nCol,nKeyFlag| msginfo( eval(oBrw:acols[oBrw:nAt()]:bStrData) ) }
oBrw:SetArray( aStatus )
for n := 1 to len(aStatus)
oBrw:aCols[n]:bClrStd := {|| { CLR_BLACK, iif(eval(oBrw:aCols[n]:bStrData)='X',CLR_RED,CLR_WHITE) } }
next
oBrw:CreateFromCode()
oWnd:oClient := oBrw
ACTIVATE WINDOW oWnd ON INIT oBrw:SetFocus()
return nil
Regards,
Dutch