Hola quiero cambiar de color con una condición las lineas del listbox que cumplen con la misma, como lo debo hacer.
Gracias anticipadas,
Juan Fco.
Rep. Dom.
Cambiar de Color una linea del LISTBOX
-
- Posts: 84
- Joined: Fri May 09, 2008 8:19 pm
Re: Cambiar de Color una linea del LISTBOX
Te pongo este ejemplo amigo, espero que te sirva, esta hecho con listbox
oLbx4:bTextColor := { | nRow, nCol, nStyleLine | ColoresTexto( nRow, nCol, nStyleLine, oDlg2 ) }
STATIC Function ColoresTexto( pnRow, pnCol, pnStyle, oFolder )
Local cColor, nPaso, i:=0, cCampo:=""
DO CASE
CASE pnStyle = 0 .AND. pnCol = 6 .AND. (S13)->MV_CARG < 0
cColor := CLR_HRED
CASE pnStyle = 0 .AND. pnCol = 7 .AND. (S13)->MV_ABON < 0
cColor := CLR_HRED
CASE pnStyle = 0 .AND. pnCol = 8 .AND. (S13)->IMPBS1 < 0
cColor := CLR_HRED
CASE pnStyle = 0 .AND. pnCol = 10 .AND. (S13)->IVA_1 < 0
cColor := CLR_HRED
CASE pnStyle = 0 .AND. pnCol = 11 .AND. (S13)->IMPBS2 < 0
cColor := CLR_HRED
CASE pnStyle = 0 .AND. pnCol = 13 .AND. (S13)->IVA_2 < 0
cColor := CLR_HRED
CASE pnStyle = 0 .AND. pnCol = 14 .OR. pnCol = 16 .AND. (S13)->OTROS < 0
cColor := CLR_HRED
ENDCASE
RETURN( cColor )
Saludos
Atte: Adrian C. C.
oLbx4:bTextColor := { | nRow, nCol, nStyleLine | ColoresTexto( nRow, nCol, nStyleLine, oDlg2 ) }
STATIC Function ColoresTexto( pnRow, pnCol, pnStyle, oFolder )
Local cColor, nPaso, i:=0, cCampo:=""
DO CASE
CASE pnStyle = 0 .AND. pnCol = 6 .AND. (S13)->MV_CARG < 0
cColor := CLR_HRED
CASE pnStyle = 0 .AND. pnCol = 7 .AND. (S13)->MV_ABON < 0
cColor := CLR_HRED
CASE pnStyle = 0 .AND. pnCol = 8 .AND. (S13)->IMPBS1 < 0
cColor := CLR_HRED
CASE pnStyle = 0 .AND. pnCol = 10 .AND. (S13)->IVA_1 < 0
cColor := CLR_HRED
CASE pnStyle = 0 .AND. pnCol = 11 .AND. (S13)->IMPBS2 < 0
cColor := CLR_HRED
CASE pnStyle = 0 .AND. pnCol = 13 .AND. (S13)->IVA_2 < 0
cColor := CLR_HRED
CASE pnStyle = 0 .AND. pnCol = 14 .OR. pnCol = 16 .AND. (S13)->OTROS < 0
cColor := CLR_HRED
ENDCASE
RETURN( cColor )
Saludos
Atte: Adrian C. C.