Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Referencing objects
Message
De
05/01/1998 11:54:08
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
05/01/1998 11:52:37
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00069346
Message ID:
00069545
Vues:
43
>>How does one find which objects within a form which have certain properties?
>>For example If I wish to write a generic routine changing all disabled properties from .f. to .t.
>>
>>for a = 1 to (what function)
>> if (what array?).disabled = .f.
>> (what array).disabled = .t.
>> endif
>> a = a + 1
>>endfor
>>
>>How do I reference objects withn a form generically?
>>Thanks for your help
>>Spencer Fried
>>sfried3@ix.netcom.com
>
>You would recursively check controls (and containers' controls) and if they have disabled property defined and !readonly, protected etc would make them true. Sounds easy ? Well I'll try to write one to do job (since we are gonna deal only with enabled property no need to check for readonly, protected) :
>
>
>* Custom Method SetallEnabled2Disabled (as far as I know property enabled exists for all type of objects but not disabled)
>
>Function SetallEnabled2Disabled
>lparameters oContainer
>with oContainer
>for ix=1 to .controlcount
>    .controls(ix).enabled = .f.
>    if .controls(ix).baseclass = "Container"
>       =SetAllEnabled2Disabled(.controls(ix))
>    endif
>endfor
>
>
>I think this would set everything to disabled but haven't tried, wrote here. I would call it SetallEnabled2Disabled(thisform) then immediately set a control to enabled for a safeguard.
>cetin
As I said I didn't try it and forgot the closing ENDWITH.
Ç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
Répondre
Fil
Voir

Click here to load this message in the networking platform