Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Form won't give up focus
Message
From
12/03/2022 15:55:20
 
 
To
11/03/2022 14:06:18
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
01683822
Message ID:
01683843
Views:
74
>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

Hello Tamar, have you checked the Deactivate() or LostFocus() methods of the first form?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform