FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour How to change de colortext of oBar in runtime?
Posts: 2170
Joined: Fri Jul 18, 2008 01:24 AM
How to change de colortext of oBar in runtime?
Posted: Wed Oct 06, 2010 03:33 PM

How I can do to change the colortext of ButtonBar in runtine?
I have the following function.
It change perfectly the ButtonBar and his buttons colors, but not the button color-text.
I Traid this...

Function Color_oBar(oBar,cColor)
local n
DEFAULT cColor := NIL
IF !cColor = NIL
if cColor = "ORO"
oBar:bClrGrad := { | lInvert | If( ! lInvert, ;
{ { 1.00,14481663,38075 }, ;
{ 1.00,38075,14481663 } }, ;
{ { 0.10,16777215,9363707 },;
{ 0.10,9363707,16777215 } } ) }
oBar:nClrText := 0

elseif cColor = "NOCHE"
oBar:bClrGrad := { | lInvert | If( ! lInvert, ;
{ { 0.70,0,12429486 },;
{ 0.70,12429486,0 } },;
{ { 0.40,9928844,12429486 },;
{ 0.40,12429486,9928844 } } ) }
oBar:nClrText := 521724

endif
ENDIF
for n:= 1 to len(oBar:aControls)
oBar:aControls[n]:Refresh() //.or. Paint() not work
next
oBar:Refresh() // work
Return nil

Thanks in advance.

Francisco J. Alegría P.

Chinandega, Nicaragua.



Fwxh-MySql-TMySql
Posts: 2170
Joined: Fri Jul 18, 2008 01:24 AM
Re: How to change de colortext of oBar in runtime? (SOLVED)
Posted: Wed Oct 06, 2010 04:24 PM

SOLVED...!!!:
...
...

oBar:bClrGrad := { | lInvert | If( ! lInvert, ;
{ { 0.70,0,12429486 },;
{ 0.70,12429486,0 } },;
{ { 0.40,9928844,12429486 },;
{ 0.40,12429486,9928844 } } ) }
nClrTexto := 521724

for n:= 1 to len(oBar:aControls)
oBar:aControls[n]:nClrText := nClrTexto
oBar:aControls[n]:Refresh()
next
oBar:Refresh()

Francisco J. Alegría P.

Chinandega, Nicaragua.



Fwxh-MySql-TMySql

Continue the discussion