Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to remove picture with SetAll
Message
De
08/05/2003 07:17:42
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
07/05/2003 17:30:05
Peter Wagner
Point Informática Ltda.
Limeira, Brésil
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00786028
Message ID:
00786131
Vues:
18
>In a class for the Header click event I try to remove the Picture from other columns of the grid.
>Im using SetAll to remove the image but it's not Working.
>Could someone explain why or what Im missing.
>
>Thanks in advance
>
>Peter
>
>
>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
>                                     && Problem !!
>					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
>
>

Peter,
Header class might not be base header class (and to me it sounds it's not).
THIS.PARENT.PARENT.SETALL("Picture",'')
Would do it for ALL controls in grid. Just for headers you could do this :
for each oCol in this.parent.parent.Columns
 for each oControl in oCol.Controls
    if lower(oControl.Baseclass) == 'header'
        oControl.picture = ''
    endif
    oControl = .null.
 endfor
 oCol = .null.
endfor
Or assuming it's a custom header class with a property HeaderPicture and method HeaderPicture_assign :
*HeaderPicture_assign
lparameters vNewVal
store vNewVal to this.Picture, this.HeaderPicture

* Then you could say :
THIS.PARENT.PARENT.SETALL("HeaderPicture",'')
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform