Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
DynamicBack/Fore Coloring
Message
 
À
25/08/1997 16:51:59
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00046756
Message ID:
00046919
Vues:
33
>>>>>I'd like to make it more generic by using a variable to enter the coloring but I always get an "Invalid expression in the Dynamic...."
>>>>>The variable is a property of the grid and the something = something is properly evaluated as they are properties of the grid too.
>>>>>
>>>>>THIS.gnForeColor = some valid color value
>>>>>
>>>>>Example: IIF(something = something, THIS.gnForeColor, ........
>>>>>
>>>>These variables seem to need a wider scope...try it as a form property.
>>>
>>>Hi Bruce,
>>>
>>>I'll give that a try but why would the evaluated expression understand "THIS" being in the grid but not the color properties? IIF(RECNO(THIS.RecordSource) = THIS.gnLastRec, color, color) - The statement understands THIS.RecordSource and THIS.gnLastRec just fine, it just doesn't do the colors unless I have the RGB funtion included.
>>>
>>
>>Good question...I had trouble with it too...all I'm sure of is that it works for me as a form property (I also have "gnLastRec" at the form level, that wouldn't work for me locally. I've only had success with everything at the form scope level...
>
>Dynamicforecolor, backcolor, etc are properties of the column, not of the grid. If you want to reference a property of the grid, you must use this.parent.property. Using this.controlsource in the dynamicforecolor would work because control source is also a property of the column, but recordsource is a property of the grid, so referencing it would also require this.parent. I suspect that the reason that it worked for Bruce at the form level was because he used thisform. I am interested to see if this solves it.

Erik,

I understand that the "Dynamic" properties belong to the column and will take a look at referencing the grid properties with .Parent. The IIF statement should not care though as it properly translates THIS.RecordSource and THIS.gnLastRec, both of which are properties of the grid. I have some experimenting to do with all of this as I'd much rather lose the RGB calls. I'll get back to you and let you all know what works.

Steve
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform