Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Form won't give up focus
Message
From
20/03/2022 13:06:26
 
 
To
16/03/2022 13:26:55
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
01683822
Message ID:
01683908
Views:
87
Likes (1)
>>>Got another tricky one. I'm working on a large vertical market application. It was originally created in FPW using the Stonefield Appmaker framework. We're converting forms to VFP, using a framework that's as close to the old one as we can manage, except taking advantage of VFP features like classes and buffering. Mostly, this is going very well.
>>>
>>>But we have one issue that comes up now and then, and I can't figure out. Sometimes, when a user has two forms open, one of the forms won't give up focus. That is, the user clicks on the other form, but the one they're already on stays in front. I've found that this is most common when the second form has just opened, or in some cases, when you've just changed records. Once you tab to another control, the problem disappears.
>>>
>>>I thought the problem was specifically related to opening with focus on a listbox class that we use in parent-child forms, and so we've made a point of not allowing a form to open with focus on a list of that class. But this week, a user ran into the issue with focus on a button; the user used the toolbar to open another form (our picklist form) and it opened behind the form he was on. Keyboarding Tab, Backtab at the end of the form's Init solved the problem for when the form first opens, but we're also seeing it on this form after using the menu or toolbar to move to another record. The workaround is to make sure focus after moving the record pointer lands somewhere other than that button.
>>>
>>>When I first encountered this problem quite a while back, I looked at code and I used the Event Tracker and I couldn't find an explanation. Since I was able to find a workaround, and it seemed to be limited to opening a form with focus on the listbox, we let it go for then. Now that we're seeing it elsewhere, it's time to track this down.
>>>
>>>So has anybody seen anything like this? Any thoughts about how to nail it? What else do you need to know?
>>>
>>>Tamar
>>
>>Just a suggestion, but could the Valid event of the Listbox be returning a response of False. This would force the Listbox to retain focus, so the form would remain in focus also.
>
>Good thought and I'll check. I think it's unlikely because the lists are based on a new class that doesn't use the Valid code at all. But still worth a look.
>
>Tamar

Another thought. If the Listbox is bound to a table field, and there is a Validation on that field in the database, then if the validation fails, it might cause the effect you are experiencing.
Greg Reichert
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform