|
#1
|
|||
|
|||
|
Screen.SetFocus()
When a Verify Serial Number (or an Edit Field) screen appears, I want the first input box to have the focus. I entered the Screen.SetFocus() command as a On Preload action. It did not work. I added Screen.GetFocus(), and 821 (=CTRL_EDIT_01) was reported before the screen showed up, but always the Next button had the focus (I had to press TAB twice to enter the input box).
The help file is cryptic: Note: This action will not function correctly if called from the On Preload event. You cannot set focus to static controls or controls that are not visible, or disabled. At last I found a working solution: Code:
On Preload: Screen.StartTimer(500); On Ctrl Message: if MSGID_ONTIMER then Screen.SetFocus(CTRL_EDIT_01); end In any case: This solution works excellent. |
|
#2
|
||||
|
||||
|
I agree that this isn't the best way to do it, however from what I can see, it seems to be the "only" way to do it. I'll submit a report to see if something can be done in this respect, however I believe there may be undesirable results if it was changed.
Darryl |
|
#3
|
|||
|
|||
|
Addition
I suggest to add a line to stop the timer:
Code:
if MSGID_ONTIMER then Screen.SetFocus(CTRL_EDIT_01); Screen.StopTimer(); --Note: The screen's timer is automatically stopped when a different screen is displayed. end |
|
#4
|
|||
|
|||
|
Forget this old stuff!
With v7.0.2.0 you only need Screen.SetFocus(CTRL_EDIT_01) in the On Preload pane. (Ref. http://www.indigorose.com/forums/showthread.php?t=11112) |
![]() |
«
Previous Thread
|
Next Thread
»
| Thread Tools | |
| Display Modes | |
|
|
All times are GMT -6. The time now is 12:27 PM.








Linear Mode
