Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Combobox not stopping for user input
Message
From
14/08/1999 11:30:13
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Title:
Combobox not stopping for user input
Miscellaneous
Thread ID:
00253765
Message ID:
00253765
Views:
50
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.

If they choose to leave that field empty, they are offered the option to make another selection from the first combo.

The call to the combo is identical to the first call (last line of the calling method and not nested) but this time, we don't get the popdown, it just races through to the valid and spits out the 'nothing selected' error message because, obviously, the user hasn't has a chance to make any selection. I've had to trap it with a 'return .f.' in the valid if no value is selected. This makes it work but its an ugly kludge with an unnecessary 'invaliid input' warning to the user. (ok, so I could suppress that too but thats even more of a kludge!)

The debugger might help if I knew what I was looking for but I'm stumped.

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

I thought this might have somehow been the problem till I realised that it was making the same call both when it worked and when it didn't. At the end of the combobox when method it calls the form.activate, as do most other controls. If you've got code in the activate it will run it every time which could be a completely unnecessary waste of processing time. I've created a form property call 'activated which is set true the first time the activate is called. The activate now only runs when not 'form.activated' - otherwise it reads a 'nodefault'. Apart from having to reset it if I hide the form or whatever, is there any other reason I should be allowing the activate to run as often as it wants to?


Harry
Next
Reply
Map
View

Click here to load this message in the networking platform