FIX: PAGE UP and PAGE DOWN in FormSet with Toolbar Crashes VFPLast reviewed: October 29, 1997Article ID: Q160917 |
The information in this article applies to:
SYMPTOMSWhen you use the PAGE UP or the PAGE DOWN keys in a Formset that contains a Toolbar, Visual FoxPro 5.0 crashes.
WORKAROUNDPut the following code in the KeyPress Method of the form. However, the best location would be in the KeyPress Method of the form super class:
DO CASE CASE nKeyCode = 3 && PageDown NODEFAULT && Don't let VFP do it's own thing for this KeyStroke. && Loop through the forms in the Formset. FOR i = 1 TO THISFORMSET.FORMCOUNT && Find the active form in the forms collection. IF THISFORMSET.FORMS(i).NAME = THISFORMSET.ACTIVEFORM.NAME && See if the next number(i) in the Formset is a valid number && regarding FormCount. IF BETWEEN(i+1,1,THISFORMSET.FORMCOUNT) && If it is, see if the next form is a Form and not a Toolbar. IF UPPER(THISFORMSET.FORMS(i+1).baseclass) = 'FORM' && If it is, show the Form and get out. thisformset.FORMS(i+1).SHOW() EXIT ENDIF ELSE && If the next number(i) was not a valid number regarding && FormCount, start the loop again from the top. This keeps && the "expected flow" or expected navigation of the forms. FOR li = 1 TO THISFORMSET.FORMCOUNT && See if the next form in the Formset is a Form and not a && Toolbar. IF UPPER(THISFORMSET.FORMS(li).baseclass) = 'FORM' && If it is, Show the Form and get out. thisformset.FORMS(li).SHOW() EXIT ENDIF ENDFOR ENDIF ENDIF ENDFOR CASE nKeyCode = 18 && PageUp NODEFAULT && Don't let VFP do it's own thing for this KeyStroke. && Loop through the forms in the Formset. FOR i = 1 TO THISFORMSET.FORMCOUNT && Find the active form in the forms collection. IF THISFORMSET.FORMS(i).NAME = THISFORMSET.ACTIVEFORM.NAME && See if the previous number(i) in the Formset is a valid number && regarding FormCount. IF BETWEEN(i-1,1,THISFORMSET.FORMCOUNT) && If it is, see if the next form is a Form and not a Toolbar. IF UPPER(THISFORMSET.FORMS(i-1).baseclass) = 'FORM' && If it is, Show the Form and get out. thisformset.FORMS(i-1).SHOW() EXIT ELSE && If the previous number(i) was not a valid number regarding && FormCount, start the loop again from the bottom. This keeps && the "expected flow" or expected navigation of the forms. FOR li = THISFORMSET.FORMCOUNT TO 1 STEP -1 && See if the next form in the Formset is a Form and not a && Toolbar. IF UPPER(THISFORMSET.FORMS(li).baseclass) = 'FORM' && If it is, Show the Form and get out. thisformset.FORMS(li).SHOW() EXIT ENDIF ENDFOR EXIT ENDIF ENDIF ENDIF ENDFOR ENDCASE STATUSMicrosoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article. This problem has been fixed in Visual FoxPro 5.0a.
MORE INFORMATIONWhen you use the PAGE UP or the PAGE DOWN keys in a Formset that contains a Toolbar, Visual FoxPro 5.0 crashes. The crash occurs when you use PAGE UP or PAGE DOWN and the next logical form in the Formset is a Toolbar form.
Steps to Reproduce Behavior
Keywords : buglist5.00 FxprgClassoop FxprgToolbar vfoxwin vfpfix5.0a kbprg kbbuglist kbfixlist Version : 5.0 Platform : WINDOWS Issue type : kbbug Solution Type : kbfix |
================================================================================
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |