Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Setfocus Error
Message
From
19/02/1999 04:36:53
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
18/02/1999 15:15:29
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Title:
Miscellaneous
Thread ID:
00188643
Message ID:
00189182
Views:
15
>Dragan,
>
>Here is what I found out. When I click suspend on the error, I checked the program flow. The problem stems from a form that is called from a combo box in the main form. I have a combo box that looks up values as the user types. If the value typed isn't in the list, another form comes up so the user can enter the information. Guess where the call to the entry form is. You guessed it, in the valid event of the combo box on the main form. Since the secondary form is called from the valid event, all subsequent setfocus() calls in the secondary form produce this error. This appears to be a nice (NOT) feature of VFP 6.0. This didn't happen at all in VFP 3.0.
>
This is also related to another thread about re-ordering a (search) grid - I got it to stay on the current record with grid.setfocus, and guess what - had to make it use thisform.activate instead, just because of this problem (in 5.0). I guess each new version of Fox is slightly more strict in what it perceives as an error. I don't mind that - I wish it were so from FoxPlus right away.

Though, I don't see a good reason for prohibiting setfocus from valid, but then it's just the implementation problem (I mean they had that problem while writing VFP, and this limitation solved it). We'd either move such code into .lostfocus, or play safe when we design forms which may be called from valid methods.

back to same old

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

Click here to load this message in the networking platform