Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Click on PageFrame Set Focus to specific control
Message
From
23/04/2004 14:47:40
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Title:
Click on PageFrame Set Focus to specific control
Miscellaneous
Thread ID:
00897736
Message ID:
00897736
Views:
51
I use the form's keypress event to trap for the pageup and pagedown keys being pressed so I can set the focus to the correct control on the page. If the user presses pageup to get to the previous page, focus is set to the last control on the page and if the user presses pagedown to get to the next page focus is set to the first control on the next page.

We have hotkeys set for listboxes on some of the pages. In each listbox when event we set ON KEY LABEL F5 DO FORM ... to allow the user to add entries to the listbox. The on key label is reset in the listbox's lostfocus. There are typically two listboxes on each page. This works fine except when the user instead uses the mouse to click on the page tab to go to a specific page. In that case the focus is on the page's tab and not on any control. The user doesn't realize this and thinks they are on the first control and presses F5 and nothing happens.

I have put code in the page's click event to setfocus to the first control on the page and it seems to do the trick. Is there any reason that this may not be a good idea? It has not been tested live yet, and I'd like to rule out any negative repercussions if possible in advance. One drawback is that I won't know if the user is moving forward or backwards in the page order so I cannot determine if focus should be on the first or last control on the page so it will always have to be the first control.

TIA!
Tracy
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Next
Reply
Map
View

Click here to load this message in the networking platform