- Troy Cowan
- PowerBuilder
- Tuesday, 30 July 2024 02:47 PM UTC
I have a situation where I have two windows open; Window A and Window B. Window A has the focus.
I click a button on Window A, and in the click event handler it calls GetFileSaveName(). Even if nothing else happens after that (I commented out all the other code that uses the return from GetFileSaveName), the focus changes to Window B. I can't figure out why this is happening.
Somehow this doesn't happen all the time. Sometimes the focus stays on Window A. I haven't figured out if there is a pattern to this, it just seems completely random.
If I put Parent.Post SetFocus() in the code after the call to GetFileSaveName the focus seems to stay on Window A as desired. I assume it could be setting focus to Window B and then back to Window A.
Any advice on how to troubleshoot this would be great.
Find Questions by Tag
Helpful?
If a reply or comment is helpful for you, please don’t hesitate to click the Helpful button. This action is further confirmation of their invaluable contribution to the Appeon Community.