Indigo Rose Software
  #1  
Old 09-27-2004
csd214 csd214 is offline
Forum Member
 
Join Date: Oct 2001
Location: Norway
Posts: 939
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
If this is "the way to do it", it should be added to the help doc.

In any case: This solution works excellent.
Reply With Quote
  #2  
Old 09-29-2004
Darryl's Avatar
Darryl Darryl is offline
Indigo Rose Staff Member
 
Join Date: Jul 2001
Location: Indigo Rose Software
Posts: 1,602
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
__________________
Darryl
Indigo Rose Corporation

Product Guides: AMS70 | SUF80 | TU30 | VP30 |MSIFACT |DeltaMAX
Reply With Quote
  #3  
Old 10-04-2004
csd214 csd214 is offline
Forum Member
 
Join Date: Oct 2001
Location: Norway
Posts: 939
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
Reply With Quote
  #4  
Old 04-18-2005
csd214 csd214 is offline
Forum Member
 
Join Date: Oct 2001
Location: Norway
Posts: 939
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)
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT -6. The time now is 12:27 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Copyright © 2000 - 2009 Indigo Rose Corporation. All rights reserved.
Indigo Rose Software