color of the checkbox / radiobox

color of the checkbox / radiobox

Postby Natter » Tue Feb 15, 2022 12:42 pm

Hi,

Is it possible to change the color of the checkbox / radiobox elements (not the text, but the icon itself) ?
Natter
 
Posts: 1224
Joined: Mon May 14, 2007 9:49 am

Re: color of the checkbox / radiobox

Postby cmsoft » Tue Feb 15, 2022 2:26 pm

Prueba con
Code: Select all  Expand view  RUN

oRad:SetColor( nClrText, nClrPane )
oChk:SetColor( nClrText, nClrPane )
User avatar
cmsoft
 
Posts: 1292
Joined: Wed Nov 16, 2005 9:14 pm
Location: Mercedes - Bs As. Argentina

Re: color of the checkbox / radiobox

Postby Natter » Tue Feb 15, 2022 3:24 pm

In this case :setColor is not suitable - they can only change the background. I need to change the color of the element itself
Natter
 
Posts: 1224
Joined: Mon May 14, 2007 9:49 am

Re: color of the checkbox / radiobox

Postby carlos vargas » Tue Feb 15, 2022 3:39 pm

if you use themes in the application, it is not possible
Salu2
Carlos Vargas
Desde Managua, Nicaragua (CA)
User avatar
carlos vargas
 
Posts: 1721
Joined: Tue Oct 11, 2005 5:01 pm
Location: Nicaragua

Re: color of the checkbox / radiobox

Postby karinha » Tue Feb 15, 2022 8:18 pm

Code: Select all  Expand view  RUN

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 NIL
 


Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7834
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: color of the checkbox / radiobox

Postby Natter » Wed Feb 16, 2022 5:40 am

Karinha, thank you!
Natter
 
Posts: 1224
Joined: Mon May 14, 2007 9:49 am


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 42 guests