Form containter, PDF via OCX and focus

Author: (sochaz)

Hello, I'm facing a strange problem. This is short version of my situation: a main form with a grid and a form container widget, a contained form with ocx container showing pdf files (using AcroPDF.PDF). In the OccurrenceGetsFocus trigger of the grid, the contained form is activated with filename and PDF is shown in the ocx container. Now, as a user browse the occurrences of the grid widget, the corresponding PDF file is shown... but sometimes the ocx container (pdf) gets the focus... as a result, the grid loses focus and keep pressing the Down Arrow Key scrolls the pdf file instead of "jumping" to the next occurrence of the Grid. I have tried to "setformfocus" back to the main form - it helps a bit, the focus is not lost so often, but still it is lost from time to time. Hopefully, my description is clear enough... my question is, does anybody faced the same or similar problem? Is there any change to prevent this behavior? By the way, with simple contained form (no ocx widget) everything works just as expected, but the end-users insist on instantly seeing the PDF within the application while browsing the occurrences of the grid (no need to click anywhere). Zdeněk

This page has no comments.