Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Disable all except labels
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00287091
Message ID:
00287111
Vues:
22
I will...thanx!

>This is a classic recursion issue, and one I had to tackle for the Tricks classlib. If you like, you can download it and look at the RecurseIt method in the parent class.
>
>>You're absolutely correct. This would only work for controls in the form container itself. To accomplish this for containers inside containers, you'd have to check for parentage or do something like this for each contained control (using THIS instead of THISFORM, of course).
>>
>>Another thought (I just had -g-) is that you could use THISFORM.ControlCount instead of determining the value of lnControls.
>>
>>>Hi Evan,
>>>
>>>This won't work if you have containered containers, ie, Pageframes in Pageframes.
>>>
>>>
>>>>Try this code:
>>>>
>>>>lnControls = ALEN( THISFORM.Controls )
>>>>FOR lnLoop = 1 TO lnControls
>>>> IF UPPER( THISFORM.Controls[ lnLoop ].BaseClass ) # "LABEL"
>>>> THISFORM.Controls[ lnLoop ].Enabled = .F.
>>>>
>>>> ENDIF && check for all non-label controls
>>>>ENDFOR && lnLoop
>>>>
>>>>>What's the best way to disable all of the controls on a form except labels?
>>>>>
>>>>>TIA
Evan Pauley, MCP
Positronic Technology Systems LLC
Knoxville, TN

If a vegetarian eats vegetables, what does a humanitarian eat?
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform