Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Problem with EVALUATE()
Message
 
À
26/02/2006 05:28:20
Reza Meamar
Homa Programming Group
Shiraz, Iran
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 7 SP1
Divers
Thread ID:
01099237
Message ID:
01099252
Vues:
15
>>>Hi all,
>>>I have a problem with =EVALUATE()
>>>I have a form with one grid in it.
>>>I put below code in a method ( SetGridEnabled ) and run it where i want.
>>>
>>>
>>>FOR nCounter = 1 TO 4
>>>    = EVALUATE("thisform.grid1.column"+ALLTRIM(STR(nCounter))+".Enabled = .F.")
>>>    = EVALUATE("thisform.grid1.column"+ALLTRIM(STR(nCounter))+".text1.Enabled = .F.")
>>>ENDFOR
>>>
>>>
>>>but it is not worked.
>>>if i use this as below
>>>
>>>
>>>thisform.grid1.column1.Enabled = .F.
>>>* other column
>>>
>>>
>>>it worked.
>>>WHY?
>>
>>EVAL() evaluate a expression, set a property is a command.
>>
>>When you set column's enabled, VFP copy the value into the column's control ( text )
>>
>>But you can use columns collection:
>>
>>with thisform.grid1
>> FOR nCounter = 1 TO 4
>>    .columns[m.nCounter].Enabled = .F.
>> ENDFOR
>>endwith
>>* for all columns you can set
>>thisform.grid1.Enabled = .F. && this set all columns and textboxes
>>
>
>Dear Fabio,
>if i use from
>
>thisform.grid1.Enabled = .F. && this set all columns and textboxes
>
>
>user can not scroll in grid. i want my user can scroll but can not edit values.

Hi Reza,
Then use Readonly instead Enabled
thisform.grid1.Readonly = .t.
_______________________________________________________________
Testing displays the presence, not the absence of bugs.
If a software application has to be designed, it has to be designed correctly!
_______________________________________________________________
Vladimir Zografski
Systems Analyst
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform