>LOCAL oCol >FOR EACH oCol IN THIS.COLUMNS > IF TYPE('oCol.Header1')='O' > oCol.REMOVEOBJECT('Header1') > oCol.NEWOBJECT('Header1','Header_indexa','Header_indexa.prg') > ENDIF > oCol = .NULL. >ENDFOR >>
>THIS.PARENT.PARENT.SETALL("Picture","C:\BMPS\UP.BMP","Header") >>and this code in another Header (another column) to remove the pictures
> THIS.PARENT.PARENT.SETALL("Picture","","Header") && <<- Works fine >>It works as expected, then it removes the picture, but in the same doesnt happens when the code is in the Header Class.
>DEFINE CLASS Header_indexa AS HEADER >PROCEDURE CLICK >LOCAL nome_cursor, nome_column, nrecno, nome_grid >nrecno = RECNO() >nome_column = THIS.PARENT.CONTROLSOURCE >nome_column = SUBSTR(nome_column,AT('.',nome_column) + 1) >nome_cursor = SUBSTR(nome_column,1,AT('.',nome_column) -1) >nome_grid = THIS.PARENT.PARENT.NAME >IF TAGCOUNT(nome_cursor) > 0 > FOR nCount = 1 TO 30 > IF !EMPTY(TAG(nCount)) > IF UPPER(TAG(nCount)) = UPPER(nome_column) > DO CASE > CASE UPPER(JUSTSTEM(THIS.PICTURE)) = "UP" > SET ORDER TO TAG nome_column DESCENDING > THIS.PICTURE = 'C:\BMPS\Down.bmp' > > CASE UPPER(JUSTSTEM(THIS.PICTURE)) = "DOWN" > SET ORDER TO TAG nome_column ASCENDING > THIS.PICTURE = 'C:\BMPS\UP.BMP' > > OTHERWISE > THIS.PARENT.PARENT.SETALL("Picture","","Header") > > SET ORDER TO TAG nome_column ASCENDING > THIS.PICTURE = 'C:\BMPS\UP.BMP' > ENDCASE > > THIS.PARENT.PARENT.REFRESH > GOTO nrecno > EXIT > ENDIF > ENDIF > ENDFOR >ENDIF >ENDPROC >ENDDEFINE >>