Microsoft KB Archive/189710

= FIX: ActiveX Control Shows Through Page After Modal Form Runs =

Article ID: 189710

Article Last Modified on 8/19/1999

-

APPLIES TO


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

-



This article was previously published under Q189710



SYMPTOMS
After you display a modal form from a calling form that has an OleContainer/ActiveX control in an inactive Pageframe page, the ActiveX control bleeds through and displays on the active page.



RESOLUTION
After you display and then close the modal form, set the Visible property of the OleContainer control holding the ActiveX control to .F., then back to .T.



STATUS
Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. This has been corrected in Visual FoxPro 6.0.



Steps to Reproduce Behavior
  Run the following code from a program (.prg) file: PUBLIC OFORM1 OFORM1=CREATEOBJECT("form1") OFORM1.SHOW

DEFINE CLASS FORM1 AS FORM AUTOCENTER = .T.        NAME = "Form1" HEIGHT = 300

ADD OBJECT PF1 AS PAGEFRAME WITH ; PAGECOUNT = 2

ADD OBJECT CMD1 AS COMMANDBUTTON WITH ; TOP = 275, ; NAME = 'cmd1', ; CAPTION = 'Do form 2', ; LEFT = 140

PROC INIT THIS.PF1.PAGE2.ADDOBJECT('olecls1','olecls') THIS.PF1.PAGE2.OLECLS1.VISIBLE = .T.        ENDPROC

PROC CMD1.CLICK OY = CREATEOBJECT('form') OY.CAPTION = "Click on the X to close me!" OY.SHOW(1) ENDPROC

ENDDEFINE

DEFINE CLASS OLECLS AS OLECONTROL HEIGHT = 100 WIDTH = 100 NAME = "olecls" OLECLASS = 'RICHTEXT.RichtextCtrl' ENDDEFINE  Note that the ActiveX control is not visible. Click Page2 to display the ActiveX control, and then click Page1. Next, click the "Do Form 2" button. Close the second form by clicking the Close button in the upper right corner of the screen.</ol>

RESULTS:


 * The ActiveX control now displays on Page1.
 * You can hide the control by clicking Page2, then clicking back to Page1.

To demonstrate the solution described in the RESOLUTION section using the preceding example, place the following code in the CMD1.CLICK procedure, immediately after the line OY.SHOW(1): THISFORM.PF1.PAGE2.OLECLS1.VISIBLE = .F.  THISFORM.PF1.PAGE2.OLECLS1.VISIBLE = .T. Toggling the ActiveX control's visible property prevents the control from incorrectly displaying on Page1.

Additional query words: kbVFp500 kbVFp500a kbVFp600fix kbActiveX kbvfp600

Keywords: kbbug kbfix KB189710

-

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

© Microsoft Corporation. All rights reserved.