Microsoft KB Archive/245781

= BUG: DEFINE WINDOW in Load Event Does Not Appear =

Article ID: 245781

Article Last Modified on 10/16/2002

-

APPLIES TO


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

-



This article was previously published under Q245781



SYMPTOMS
A form or a formset contains a DEFINE WINDOW command in the Load event. However, the window does not appear when the form runs. The window is in Visual FoxPro's memory.



RESOLUTION
Move the DEFINE WINDOW command from the Load event to the Init event or the Activate event of the form or formset. The behavior of the DEFINE WINDOW command varies depending on which event you choose. The "More Information" section discusses the differences.



STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.



MORE INFORMATION
This behavior can occur when transporting FoxPro 2.x screens into Visual FoxPro using the Transport utility. A functional conversion can place a DEFINE WINDOW in the Load event under some circumstances. The following steps also apply if you are using a formset:

Steps to Reproduce Behavior
 Create a form.  Add a command button that has a Caption of "Exit" and that contains the following in the Click event: CLEAR WINDOW test ThisForm.Release   Place the following code in the Load event of the form: DEFINE WINDOW Test ; AT 0.000, 0.000 ; SIZE 28, 80 ; TITLE "This is a test window." ;  FONT "MS Sans Serif", 8 ; FLOAT ; MINIMIZE ; SYSTEM MOVE WINDOW Test CENTER ACTIVATE WINDOW Test @ 1,1 SAY "This is text in the test window." ;  SIZE 1,80 ; PICTURE "@I" ; FONT "MS Sans Serif", 8 ; STYLE "T"  Save and run the form. Note that only the form appears. Press the EXIT button. Copy the code from the Load event and then comment it out. Place the code in the Init event and run the form. Note that the window created with the DEFINE WINDOW appears behind the form. Press the EXIT button.</li> Copy the code from the Init event and then comment it out.</li> Place the code in the Activate event and run the form. Note that the window created with the DEFINE WINDOW appears in front the form.</li></ol>

Keywords: kbbug kbnofix kboop kbcodesnippet kbcontainer kbctrl KB245781

-

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

© Microsoft Corporation. All rights reserved.