|
PRB: Menu Pads and Bars Do Not Disable Properly on SDI FormArticle ID: Q163406Creation Date: 10-FEB-1997 Revision Date: 14-FEB-1997
The information in this article applies to:
SYMPTOMS
Menu pads and the menu bars on those menu pads do not disable properly and
then do not re-enable when changing the SKIP FOR setting when the menu is
placed in an SDI form. In the case of menu pad bars, when the SKIP FOR
setting is changed to true, the bar will not disable (turn gray) until the
second time it is chosen. However, the command or procedure assigned to
that bar will not run. In the case of the menu pad, it also does not
disable until the second time it is chosen. However, even though the menu
will drop down, the options on it will not function.
RESOLUTION
Press the ALT key to re-enable the menu pad once the SKIP FOR expression
evaluates to True. If an option on the menu pad has been disabled, the only
known way to re-enable it is to disable the pad, re-enable the bar and then
the pad (the SKIP FOR expressions should both evaluate to True), and then
press the ALT key. When the menu pad re-enables, the bar does also.
STATUS
Microsoft has confirmed this to be a problem in the Microsoft products
listed at the beginning of this article. We are researching this problem
and will post new information here in the Microsoft Knowledge Base as it
becomes available.
MORE INFORMATION
When designing a menu in the Menu Designer, a logical memory variable can
be placed in the SKIP FOR expression in the Prompt Options dialog box. The
logical values .T. or .F. can also be used for this expression but they
cannot be changed at runtime and this problem still occurs.
Steps to Reproduce Behavior
The following steps to reproduce the behavior assume a working knowledge of
the Menu Designer and Form Designer in Visual FoxPro:
xx=.F.
yy=.F.
DO FORM NoDisabl
READ EVENTS
WAIT WINDOW "Bar 1"
-and-
WAIT WINDOW "Bar 2"
DO NoDisabl.mpr WITH THIS, .T.
RELEASE MENU (THIS.Name) EXTENDED
CLEAR EVENTS
Thisform.release
xx=!xx
IF xx
WAIT WINDOW "xx is True, the pad should be disabled"
ELSE
WAIT WINDOW "xx is False, the pad should be reenabled"
ENDIF
Thisform.refresh
yy=!yy
IF yy
WAIT WINDOW "yy is True, menu bar 1 should be disabled"
ELSE
WAIT WINDOW "yy is False, menu bar 1 should be reenabled"
ENDIF
Thisform.refresh
DO NoDisable.prg - Step #7 - uncheck the Top-Level form and be sure to regenerate the menu.- Steps #10, 11 - remark out these lines of code. - Step #16 - set the ShowWindow property of the form to 0 - In Screen. - Add the following line of code to the NoDisabl.prg file just before the DO FORM NoDisabl line:
DO NoDisabl.mpr - In the NoDisabl.prg file, place SET SYSMENU TO DEFAULT after the CLEAR EVENTS command. When you run the NoDisabl program, the menu should work as expected. The Pad will not show as enabled or disabled until you click on it once or press the ALT key.
|
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.
©1997 Microsoft Corporation. All rights reserved. Legal Notices.