Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Changing between pages... not very well
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00093532
Message ID:
00093539
Views:
28
>I'm working with a Pageframe (with Page1 and Page2). Page1 have Grid1 and Page2 have Page2. I'm in Page1.Grid1.textbox and want when I press the F2 key go to Page2.grid2.textbox. Here, in the texbox there is a number xx and when I press the Enter key I want to go to Page1.grid1 and "paste" this number xx.
>
>I know how to do the Keypress, but changing the page not very well. I use this code in Page2 for the Enter key
>
>LPARAMETERS nKeyCode, nShiftAltCtrl
>DO CASE
> CASE nkeycode=13 && KEY ENTER
> THISFORM.PAGEFRAME1.PAGE1.SETFOCUS
> KEYBOARD('{ENTER}') ==> to go to last textbox (and row)
> KEYBOARD(STR(Table1.number)) ===> paste the number xx from
>table1.number
>ENDCASE
>
>This work fine but could be better (better tecnic) and have 2 problems
> 1) When the Page1.Grid1.textbox got the focus, and press enter to
>change the control (because this grid have many texbox and a combobox) this grid is not showed right.( if I do a click on the page and then on the grid this problem disapear)
> 2) I want to paste the number xx in the textbox of the column 2 ( not the texbox of the column 3 or 5)

Hi,

You might want to try ON KEY LABEL commands to swap pages.
ON KEY LABEL F?? (some method of the form)


SwapPageMethod(nKeyCode)
IF nKeyCode = GOTO Page1
THISFORM.pgFrame1.ActivePage = 1
ELSE
THISFORM.pgFrame2.ActivePage = 2
ENDIF

Or some such thing.

Also, typically pages in a pageframe will need a .Refresh() in the .Activate() event of each page.

Steve
Previous
Reply
Map
View

Click here to load this message in the networking platform