Microsoft KB Archive/185084

= PRB: Visible Property of Container Ignored by ActiveX Controls =

Article ID: 185084

Article Last Modified on 5/12/2003

-

APPLIES TO


 * Microsoft Visual FoxPro 3.0 Standard Edition
 * Microsoft Visual FoxPro 3.0b Standard Edition
 * Microsoft Visual FoxPro 5.0 Standard Edition
 * Microsoft Visual FoxPro 5.0a

-



This article was previously published under Q185084



SYMPTOMS
In Visual FoxPro 3.x and 5.x, when a parent container control has a child ActiveX control added to it, changing the Visible property of the parent container control to .F. does not hide the child ActiveX control.



RESOLUTION
The workaround is to explicitly set the Visible property of the ActiveX control to (.F.).

Replace the sample code in the Click event of the command button with the following code: IF Thisform.command1.caption = "Hide Container" Thisform.container1.visible = .F.     Thisform.container1.olecontrol1.visible = .F.      Thisform.command1.caption = "Show Container" ELSE Thisform.container1.visible = .T.     Thisform.container1.olecontrol1.visible = .T.      Thisform.command1.caption = "Hide Container" ENDIF



STATUS
Microsoft is researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.



MORE INFORMATION
This only happens if the child control is an ActiveX control. Using the FoxPro base controls works as expected.

Steps to Reproduce Behavior
 Create a form. Add a container control to the form, and name it container1.  Add a command button to the form and change the following property: Caption = "Hide Container"   In the Click event of the command button, place the following code: IF Thisform.command1.caption = "Hide Container" Thisform.container1.visible = .F.        Thisform.command1.caption = "Show Container" ELSE Thisform.container1.visible = .T.        Thisform.command1.caption = "Hide Container" ENDIF  Right-click the container and select Edit. Add a text box control and an ActiveX control (a Calendar control) as child objects to the container. Name the ActiveX control olecontrol1 and the text box control text1.</li> Save and run the form.

Click the Hide Container button and the container and the text box disappear. However, the child ActiveX control within the container remains visible.</li></ol>

Additonal query words:

Keywords: kbprb kbpending KB185084

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.