Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
CUSTOM objects not in ControlCount
Message
 
To
13/02/2003 09:41:59
Héctor Lizarraga
Gobierno Del Edo de Querétaro
Querétaro, Mexico
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00752483
Message ID:
00752716
Views:
19
This example might help.
lo = Createobject('cCustom')

With lo
? .ControlCount
**
** Adding a FoxPro Base class. Added as a Control
**
.AddObject('cmdButton1','CommandButton')
? .ControlCount
**
** Object added thru addObject. Becomes a control
**
.AddObject('oObject2','cObject2')
?.ControlCount
Endwith

Define Class cCustom As Custom
**
** Object reference added as a property defined
** in the class.
**
oObject1 = .Null.
Function Init()
oObject1 = Createobject('cObject1')
EndFunc
Enddefine

Define Class cObject1 As Custom

Enddefine

Define Class cObject2 As Custom

Enddefine

The diference being that if you create it as a property, VFP doesn't see it as a control. Just a property. If you add it on the fly it becomes a control.

Hope this helps

>Yea, you're right, I have no problem accesing the objects the way you're saying but my problem is that I need to make a loop through them. Someting like:
>
>With oApp.Modules.ControlCount
> do something
>endwith
>
>The property ControlCount is 0 in oApp (the master object), even when there are 5 objects (CUSTOM class) attached. Why?
>
>Any idea?
Mark S. Swiencki
EPS Software www.eps-software.com
mark@eps-software.com
Previous
Reply
Map
View

Click here to load this message in the networking platform