>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?

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



_______________________________________________
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