Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Combobox not stopping for user input
Message
From
14/08/1999 12:10:47
 
 
To
14/08/1999 11:30:13
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00253765
Message ID:
00253769
Views:
12
>Thought I'd got this one cracked. I understand that you can't call a setfocus and then have other lines of code immediately after it because it will just run straight through. So I only call the combobox as the last line of the relevant methods.
>
>This works. For the first call only. It duly pops down its list and the user can make a choice.
>
>The code then moves the user on to another combo which also duly pops down and allows a choice.
>
>From there we move to a freeform field where the user can edit the next part of the entry.
>

Harry, I think you are approaching this wrong. The VFP environment wasn't designed to let you "guide" the user through a form. VFP (and Windows, for that matter) are event driven environments. That means they are designed to sit and wait to see what the user does next. When you say the code then "moves the user on to another combo" it tells me that you are trying to approach your data entry problem from a procedural straight-linr angle, and that's just not how VFP works. A lot of things you will try to get this to work will feel like kludges, because they are. It's just not natural.

Design your forms with a tab order. And that's all. Let the user go all about the form, doing whatever he feels like, and then validate input when she clicks the Ok button. You don't need a "controlling" procedure that attemps to move the user through the form. The tab key moves the user through the form. I NEVER call a control's SetFocus method from another control, unless I am just trying to save the user time by going there for him, but even this is rare. It's fine to enable or disable some control depending on the state that a user left another control in.

>As a side issue, why are there so many calls to the form's activate method?

The form's activate method runs when the activate event fires. The activate event fires every time the form is shown, or comes back on top of another form, or gets focus back from a MESSAGEBOX. I don't know what you are doing that is causing the activate event to fire so often, but you shouldn't worry about the method running- any code you place there should be smart enough to know when to run by checking any flags, etc.
Erik Moore
Clientelligence
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform