Hi,
Is it possible to change the color of the checkbox / radiobox elements (not the text, but the icon itself) ?
Hi,
Is it possible to change the color of the checkbox / radiobox elements (not the text, but the icon itself) ?
oRad:SetColor( nClrText, nClrPane )
oChk:SetColor( nClrText, nClrPane )In this case :setColor is not suitable - they can only change the background. I need to change the color of the element itself
if you use themes in the application, it is not possible
FUNCTION...
...
REDEFINE RADIO oRadMenu VAR nOpcaoRadio ID 201, 202 OF oDlg UPDATE ;
ON CHANGE( TROCA_INDICE( nOpcaoRadio, cAlias, oLbx ), ;
oLbx:GoTop(), oLbx:Refresh(), oLbx:SetFocus() )
oRadMenu:SetFont( oFnt )
oRadMenu:aItems[1]:cTooltip := "Por Nome "
oRadMenu:aItems[2]:cTooltip := "Por Codigo "
ACTIVATE DIALOG oDlg CENTERED ON INIT CTRLS_COLORS( oDlg )
RETURN NIL
// By Giovanny Vecchi
FUNCTION CTRLS_COLORS( f_oDlgContainer )
LOCAL lc_aCtrls := {}, lc_iFor := 0
LOCAL lc_aItemsRadio := {}
lc_aCtrls := f_oDlgContainer:aControls
FOR lc_iFor := 1 TO Len( lc_aCtrls )
IF ValType( lc_aCtrls[lc_iFor] ) == "O"
IF lc_aCtrls[lc_iFor]:ClassName() == "TRADIO"
aEval( lc_aCtrls[lc_iFor]:oRadMenu:aItems, ;
{|_oRadId|{ SetWindowTheme( _oRadId:hWnd, "", "" ), ;
_oRadId:SetColor( CLR_CYAN, CLR_WHITE ) } } )
ELSEIF lc_aCtrls[lc_iFor]:ClassName() == "TCHECKBOX"
// SetWindowTheme( lc_aCtrls[lc_iFor]:hWnd, "", "" )
// lc_aCtrls[lc_iFor]:SetColor( G_COLOR_SYS( 31 ), G_COLOR_SYS( 1 ) )
ENDIF
ENDIF
NEXT
RETURN NILKarinha, thank you!
cmsoft wrote: Prueba conHola gente... retomando este tema que alguna vez leí y no pude hacer funcionar.oRad:SetColor( nClrText, nClrPane ) oChk:SetColor( nClrText, nClrPane )
// By Giovanny Vecchi - TESTRAD.PRG
FUNCTION CTRLS_COLORS( f_oDlgContainer )
LOCAL lc_aCtrls := {}, lc_iFor := 0
LOCAL lc_aItemsRadio := {}
lc_aCtrls := f_oDlgContainer:aControls
FOR lc_iFor := 1 TO Len( lc_aCtrls )
IF ValType( lc_aCtrls[lc_iFor] ) == "O"
IF lc_aCtrls[lc_iFor]:ClassName() == "TRADIO"
aEval( lc_aCtrls[lc_iFor]:oRadMenu:aItems, ;
{|_oRadId|{ SetWindowTheme( _oRadId:hWnd, "", "" ), ;
_oRadId:SetColor( METRO_ORANGE, CLR_WHITE ) } } )
ELSEIF lc_aCtrls[lc_iFor]:ClassName() == "TCHECKBOX"
SetWindowTheme( lc_aCtrls[lc_iFor]:hWnd, "", "" )
lc_aCtrls[lc_iFor]:SetColor( METRO_ORANGE, CLR_WHITE )
ENDIF
ENDIF
NEXT
RETURN NILGracias Karinha por responder!
Se ejecuta en el ON INIT del Diálogo?
Me respondo solo porque lo probé.. si si.. se ejecuta en la cláusula ON INIT del diálogo!
Muchas gracias!!
Roberto
TOTOVIOTTI wrote: Gracias Karinha por responder!Muy bién!
Se ejecuta en el ON INIT del Diálogo?
Me respondo solo porque lo probé.. si si.. se ejecuta en la cláusula ON INIT del diálogo!
Muchas gracias!!
Roberto
ACTIVATE DIALOG oDlg CENTERED ON INIT CTRLS_COLORS( oDlg )Gracias Karinhaaaaaaaaaaaaaaa!!