Article ID: 160917
Article Last Modified on 10/16/2002
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
Keywords: kbbug kbfix kbvfp500afix kbprogramming KB160917