Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Where to setfocus()?
Message
From
16/08/2004 12:04:28
Dragan Nedeljkovich
Now officially retired
Zrenjanin, Serbia
 
 
To
05/08/2004 18:52:30
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00931180
Message ID:
00933583
Views:
26
>I have a form with an option group which is programmatically set-up at runtime in the .init event.
>I want the focus to be set to an option which is also determined at run-time. If I setfocus() to the option button during the .init() event the form immediately becomes visible which seems inelegant to me.
>
>Is there a better way in general of setting the control which is to receive initial focus at run-time? There are many examples of why you would want to do this, eg using the same form for adding a new record and editing an existing record. In the case of adding you would want the first user editable control (say a textbox) to be selected. In the case of editing you would want the OK button selected.

How about setting the tab order for all other controls to something higher (maybe you can do that in design mode), and have the optiongroup have taborder=1? That should give it the focus without any extra action.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform