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

On Thursday, January 08, 2009 12:20 PM, Ken Dibble wrote:
>>An instance of my control class will expand its screen use temporarily in
>>certain conditions and I want it to overlay whatever it collides
>>with.  This can be handled with zorder except for ActiveX controls.  I
>>would like to have the class smart enough to make interfering ActiveX
>>controls temporarily invisible when the control needs the real estate.
>>
>>How could I do this?
>
>Date: Thu, 08 Jan 2009 12:20:01 -0500
>From: Ken Dibble
>To: [email protected]
>cc:
>Subject: Re: Is there a way to programmatically determine what if anycontrols 
>are in a given area of the current form
>
>In a simple test I was able to do it this way with the MS Calendar Control:
>
>I put an instance of the calendar control on a form. In the form I created
>a method called "ToggleActiveX()":
>
>LPARAMETERS lEnable
>
>THISFORM.OleControl1.Visible = lEnable
>
>I put an editbox on the form, overlaying the calendar control, and set its
>Visible property to .F. I put a command button on the form (for demo
>purposes only) and put this code in its Click() method:
>
>THISFORM.ToggleActiveX(.F.)
>
>THISFORM.Editbox1.Visible = .T.
>
>When I click the button on the running form, the calendar disappears and
>the editbox appears in its place.
>
>You can get much fancier with this, of course. You can use a naming
>convention for your ActiveX instances and cause the HideActiveX() method to
>canvas the form for controls matching the naming convention and set them
>invisible, for example. You could also track the position of those controls
>and your calculating control and only hide the ActiveX control if your
>control will actually overlay it. I gave the method a parameter so you can
>use it to redisplay the ActiveX control when your calculating control
>closes. You could set the value of the parameter to be passed in to be the
>opposite of the Visible setting of your calculating control, or to be an
>expression that determines if your control has reached a minimum size.
>
>Also, VFP 9 has some redrawing/refresh issues; sometimes in a more complex
>containership hiearchy you have to explicitly call a Refresh() or Paint()
>method of the form or a control to get everything to work.
>
>Ken
>www.stic-cil.org
>
>
>
[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