Ken and Tracy,

Thanks very much.  Your input has addressed all my questions and I 
believe I should be able to code the control to do exactly what I want! - 
Joe

On Friday, January 09, 2009 10:07 AM, Tracy Pearson wrote:
>
>Date: Fri, 9 Jan 2009 10:07:01 -0500
>From: Tracy Pearson
>To: [email protected]
>cc:
>Subject: RE: Is there a way to programmatically determine what if any 
>controlsare in a given area of the current form
>
>   THIS.Parent.SetAll("Visible", .F., "olecontrol")
>
>This will hide all ActiveX objects on the parent container. If you have a
>hidden ActiveX control on the parent container the .T. will make it visible,
>which may not be what you want.
>
>Your safest will be to loop the Parent.Objects collection.
>
>The class.init is not a good place to put code that relies on other objects.
>VFP loads from the inside out. The other objects on the parent may not be
>instantiated yet.
>
>You could put a BINDEVENT(THISFORM, "Activate", THIS, "YourCustomMethod") in
>the class init. This will insure the form has completed instantiating before
>your search code fires. Be sure to have an UNBINDEVENT() call in your custom
>class method, otherwise your code could fire multiple times.
>
>If you do get a collection of objects from the parent to quickly reference;
>Be sure to set the array to .NULL. or .F. during the destroy of your object.
>I have experienced forms that would not go away due to dangling references
>caused by this. Adding these objects to a VFP collection object could cause
>the same dangling reference issues. The array is easier to clean up. To add
>a custom property as an array end the name with [1] or a different count.
>
>
>Tracy
>
>-----Original Message-----
>From: Joe Yoder
>Sent: Thursday, January 08, 2009 5:18 PM
>
>Ken,
>
>I was hoping to have my class manage this without needing to add anything
>else to the form.  I thought there might be a function that returns what if
>any control is located in a specific screen area.  If that is not the case -
>would the following approach be feasible?
>
>   Scan through all the objects on a form building an array of ActiveX
>control names with their screen locations
>   Add a method to my class to make the appropriate Controls visible or
>invisible based on whether the  Top, Height, Left, and Width parameters
>passed in indicate a collision.
>
>I don't know how to scan the objects on a form but I assume there is a way.
>Will it be critical to have the scan run after all the controls are
>initialed or is the info accessible while my class.Init runs?  If it needs
>to run at form initialization is there provision in the system for that to
>happen?  Other gotchas?
>
>Thanks - Joe
>zoominternet.net
>
>
>
[excessive quoting removed by server]

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/[email protected]
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to