Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Grid Class and custom header replacement error
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00817621
Message ID:
00817776
Vues:
24
This message has been marked as a message which has helped to the initial question of the thread.
Any general purpose way to transfer properties from one to another or I have to use brute force methods to transfer design time properties at runtime?

modify your code as follows:
FOR EACH loColumn IN THIS.COLUMNS
  *** replace the header with custom header class
  *** created in code
  IF !EMPTY(THIS.cHeaderClass)
    SET PROCEDURE TO VSOClasses.prg ADDITIVE
    FOR EACH loObj IN loColumn.CONTROLS
      IF loObj.BASECLASS = 'Header'
        *** Save the changed properties
        lnProps = AMEMBERS( laProps, loObj, 0, 'C' )
        DIMENSION laVals[ lnProps ]
        FOR lnCnt = 1 TO lnProps
          laVals[ lnCnt ] = EVALUATE( 'loObj.' + laProps[ lnCnt ] )
        ENDFOR

	lcName = loObj.NAME
	loColumn.REMOVEOBJECT(lcName)
	loColumn.ADDOBJECT(lcName + "_new", THIS.cHeaderClass)

	loHeader = EVALUATE("loColumn." + ALLTRIM(lcName) + "_new")
        FOR lnCnt = 1 TO lnProps
          lcProp = 'loHeader.' + laProps[ lnCnt ]
          &lcProp = laVals[ lnCnt ]
        ENDFOR

	EXIT
      ENDIF
    ENDFOR
  ENDIF
  ...
  ...
ENDFOR
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform