Q187907: BUG: SDI Form Fails to Get Focus With _Screen.Visible=.F.
Article: Q187907
Product(s): Microsoft FoxPro
Version(s): WINDOWS:5.0,5.0a
Operating System(s):
Keyword(s):
Last Modified: 11-DEC-1999
-------------------------------------------------------------------------------
The information in this article applies to:
- Microsoft Visual FoxPro for Windows, versions 5.0, 5.0a
-------------------------------------------------------------------------------
SYMPTOMS
========
Setting the Visible property of the _Screen to .F. in the Load event of a SDI
(Single Document Interface) form prevents the form from gaining focus.
RESOLUTION
==========
Place the _Screen.Visible command in the Activate event of the form instead of
the Load event.
STATUS
======
Microsoft has confirmed this to be a bug in the Microsoft products listed at the
beginning of this article.
MORE INFORMATION
================
If the Debugger is open when the program runs, the SDI form gets focus as
expected.
Steps to Reproduce Behavior
---------------------------
Create a program that contains the following code and run the program:
Sample Code
-----------
LOCAL aobj[1], xx
CREATE FORM SDI NOWAIT
ASELOBJ(aobj,1)
xx = aobj[1]
xx.ShowWindow = 2
xx.Autocenter = .T.
xx.WriteMethod('Load',[_screen.visible=.f.])
xx.WriteMethod('Unload',[_screen.visible=.T.])
KEYBOARD 'Y' CLEAR
RELEASE WINDOW 'Form Designer'
DO FORM SDI
Additional query words: kbDSupport KBDSE kbVFp500abug
======================================================================
Keywords :
Technology : kbVFPsearch kbAudDeveloper kbVFP500 kbVFP500a
Version : WINDOWS:5.0,5.0a
Issue type : kbbug
Solution Type : kbnofix
=============================================================================
THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.
Copyright Microsoft Corporation 1986-2002.