Article ID: 168526
Article Last Modified on 10/16/2002
APPLIES TO
- Microsoft Visual FoxPro 5.0 Standard Edition
This article was previously published under Q168526
SYMPTOMS
In Visual FoxPro 5.0, clicking the Close button (the "x" in the upper-right corner of the form) of a Top-Level form destroys undocked toolbars. However, a docked toolbar is not destroyed. Pressing the Close button should not destroy the undocked toolbar. This happens prior to the QueryUnload event of the form and cannot be controlled by the developer.
STATUS
Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. This bug has been corrected in Microsoft Visual FoxPro version 5.0a for Windows.
MORE INFORMATION
Steps to Reproduce Behavior
Place the following code in a .prg file and run it. A Top-Level form, Myform1, with a docked toolbar appears.
**** Program Example**** PUBLIC goForm goForm = CREATEOBJECT("myform") goForm.Show() DEFINE CLASS myform AS form BackColor = RGB(255,255,255) ShowWindow = 2 oToolbar = .NULL. PROCEDURE Activate() IF ISNULL(THIS.oToolbar) THIS.oToolbar = CREATEOBJECT("mytoolbar") THIS.oToolbar.Show() ENDIF ENDPROC PROCEDURE QueryUnload() NODEFAULT ENDPROC ENDDEFINE DEFINE CLASS mytoolbar AS toolbar ShowWindow = 1 ADD OBJECT mybutton AS commandbutton WITH ; Top = 5, ; Left = 5, ; Height = 22, ; Width = 24, ; Caption = "" PROCEDURE Init() THIS.Dock(0) ENDPROC ENDDEFINE ****End of Code Example****
- While the toolbar is docked, attempt to close Myform1 by clicking the close button of the form. Since the QueryUnload contains the NODEFAULT command, the form does not close.
- Now, undock the toolbar and attempt to close Myform1 again by clicking the close button of the form. The undocked toolbar disappears.
Keywords: kbbug kbfix kbvfp500afix kbcode KB168526