I have an application (say App1). It has a datagrid that holds data items. If I right mouse click on a data item it brings up a "Item Details" window. However, App1 doesn't do this directly. Instead, it talks to another application, say App2, and App2 actually displays the "Item Details" window. My problem is as follows: 1. Bring up App2 then minimize it to the task bar. 2. On App1, right mouse click a data item to bring up the "Item Details" window. 3. The "Item Details" window comes up to the front, but it doesn't have the focus (the title bar is gray). App1 still has the focus. 4. If I close the "Item Details" window and repeat Step 2 again, this time the "Item Details" window not only comes up to the front but also has the focus. 5. If I do Step 1 again, then I get the same result as in Step 3.
I also noticed that I have this problem on some computers but not on others.
I have tried various methods to get the focus on the "Item Details" window but failed. The Focus() method just returns false.
(In fact, at first the "Item Details" window wouldn't even come to the front, but I set "Topmost" to true when the window is initialized and set it back to false after the contents are rendered, which forces the window to the front.)