I am getting Program Error 2012 "Cannot call SetFocus from within a When, Valid, RangeHigh or RangLow event." when the left or right arrow key is used to move between pages on a pageframe.
Does not occur when using mouse click to select page on pageframe.
Error goes away if form Window Type is changed to Modal (but other things break...)
With Set Step On the "Read Events" command in my main program is where the error occurs.
The error occurs on a form with only default methods on pageframe and pages, and also occurs on a form with defaults on pageframe and one user procedure on Activate Event for each page.
Sample code in .prg
DO FORM forms\frmvrmain NAME frmMain
READ EVENTS
Cancel
*** ButtonGroup1 is main menu selections on vrmain form
PROCEDURE ButtonGroup1
DO Case
CASE frmMain.Commandgroup1.Value = 1
*** vrSelect
frmMain.Hide
DO programs\vrSelect
CASE frmMain.Commandgroup1.Value = 2
CASE frmMain.Commandgroup1.Value = 3
CASE frmMain.Commandgroup1.Value = 4
CASE frmMain.Commandgroup1.Value = 5
CASE frmMain.Commandgroup1.Value = 6
ENDCASE
ENDPROC
My style of programming is rooted in FoxPro 2.6a. Generally I run a .prg which calls a form. For debugging ease I prefer to place all the code for a form in the calling .prg, instead of hidden in a form method. When the user switches to another function I .Hide the form and call another .prg
Thank you,
Alan
Does not occur when using mouse click to select page on pageframe.
Error goes away if form Window Type is changed to Modal (but other things break...)
With Set Step On the "Read Events" command in my main program is where the error occurs.
The error occurs on a form with only default methods on pageframe and pages, and also occurs on a form with defaults on pageframe and one user procedure on Activate Event for each page.
Sample code in .prg
DO FORM forms\frmvrmain NAME frmMain
READ EVENTS
Cancel
*** ButtonGroup1 is main menu selections on vrmain form
PROCEDURE ButtonGroup1
DO Case
CASE frmMain.Commandgroup1.Value = 1
*** vrSelect
frmMain.Hide
DO programs\vrSelect
CASE frmMain.Commandgroup1.Value = 2
CASE frmMain.Commandgroup1.Value = 3
CASE frmMain.Commandgroup1.Value = 4
CASE frmMain.Commandgroup1.Value = 5
CASE frmMain.Commandgroup1.Value = 6
ENDCASE
ENDPROC
My style of programming is rooted in FoxPro 2.6a. Generally I run a .prg which calls a form. For debugging ease I prefer to place all the code for a form in the calling .prg, instead of hidden in a form method. When the user switches to another function I .Hide the form and call another .prg
Thank you,
Alan