Information générale
Catégorie:
Codage, syntaxe et commandes
>>Hello All!
>>
>>I have a little question. How can I go through the ierarchy
>>of objects that appeared on screen. I know how make it with
>>the form object, but can't imagine how can I go through the
>>pageframe or grid object or another container object? My
>>primary goal is to determine that object referenced as
>>thisform.controls[i] is an container and to determine count
>>of controls of this object. I'm really sick with this problem.
>>
>>Have a nice day,
>>
>>Vladimir
>
>Besides Controls(i) you should use ControlCount property and Type function. They are available for Pageframes, Grid, etc (any container). Cheer up!
Look at txtbtns.setallprop in WIZSTYLE.VCX. Its purpose is to set .enabled and .readonly for objects on your form. It loops through .controls(i) for i = 1 TO controlcount, and calls itself recursively if .BaseClass = "container".
However, the .BaseClass of a PageFrame is not "container" and it doesn't have a .ControlCount property. Therefore, .SetAllProp misses all the objects in your pageframe, which you may have noticed if you tried to use the wizard to make a form and then put a pageframe in it. I originally made a dumb workaround involving my own method, before I realized that PageFrames have a Pages() property and a PageCount property. Pages themselves are containers. If you can get a method similar to .SetAllProp to call itself when it hits a PageFrame and loop through Pages() instead of Controls(), it should solve your problem.
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement