We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Focus problem with docking or popup windows and XPMenus

Hi all, I have a MDI scenario with some docking windows in the MDI frame, MDI child windows, and some popup windows, which are also owned by the MDI frame window. And I have a main menu and some toolbars from the XPMenu namespace in my MDI frame, containing some commands (BarItem''s) which are context sensitive to the active window. This may be a docking, a MDI child or a popup window. So in the click event, I check which window contains the focus and delegate the command to this window. With version 3.0.1.0 this worked fine. However, since I upgraded to version 3.3.0.0 (in order to get some bug fixes), this scenario does not longer work. As soon as I click on the main menu or a toolbar button, the docking (if currently not docked) or the popup window looses the focus. A second problem is if the docking window is docked and has the focus, to bring the focus to the MDI child window. Then, both windows looks aktivated, but the focus remains on the docked window. To demonstrate this problems I try to attach a sample. This sample shows a MDI scenario with a floating docking window, a popup window, and one MDI child window, all displaying a "Hello World". Now try to bring the focus on each of it and press "Say Hello" on the toolbar which makes the hello flashing red. As you can see, you can''t get the docking or the popup window flashing, because they loose their focus. How can I get this working? Is this behaviour a bug? Thanks in advance, Christian

LostFocus.zip

5 Replies

VS Vijayanand S Syncfusion Team November 29, 2005 02:21 PM UTC

Hi Christian, 1. "Floating window loses the focus when we click on the menu" - This is already a known issue. we have fixed it internally and it will be available in our next release. I will get back to you with more information about the release as soon as possible. 2. If a form is in MDI mode there is always an active child (except situations when parent form contains no children). In VS IDE, you cannot see active child because docking windows are also MDI children there. In our docking manager docking windows are not MDI children so MDI child form stays always active. Please let me know if you have any questions. Thanks for your interest in Syncfusion Products. Regards, Vijay


CH Christian November 30, 2005 06:26 AM UTC

Hi Vijay, thanks for your answer. I''m very interested on informations about a release date of the bug fix mentioned, because currently it breaks my application! on 2. If docking windows are behave different from these in VS IDE, do you have any idea how I could determine which window is active and should be the target of my context sensitive commands on the main menu? Did you check my sample for this behavior? Suppose the following scenario: the docking window is docked and focused, then you can''t get the focus back to the MDI child (both, the docking and the MDI child are displayed as ''active'', which is very confusing to the user). Now, if you create a second MDI child and change the active MDI child, then the docking looses the focus. Any idea? Thanks again, Christian


VS Vijayanand S Syncfusion Team November 30, 2005 11:11 AM UTC

Hi Christian, I was able to see the behavior which you have mentioned in the previous post. You could try to explicitly set focus on the desired form/control in the MDI form using the following interop call : [DllImport("User32.dll")] public extern static IntPtr SetFocus(IntPtr hWnd); I have modified the sample which changes the focus by clicking on the form using SetFocus method. Please take a look at the sample and let me know if this helps you. Thanks for your patience. Regards, Vijay f37607.zip


CH Christian November 30, 2005 02:32 PM UTC

Hi Vijay, thanks for your quick response! I understand the trick you mentioned. However, it does not fit well in my application. Clicking into the client area does other things, and clicking into the caption (or selecting the MDI child from "Window List" from main menu) is not covered by this trick. In my opinion, after all this behavior (two windows appears as active) is not correct. Would you affirm, that this is a bug in your implementation, or is this behavior by design? Regards, Christian


VS Vijayanand S Syncfusion Team December 2, 2005 04:36 AM UTC

Hi Christian, After having consulted the development team on this issue, I would like to provide you the following information : It is not a bug and not also by design, but a constraint enforced by the MDI child feature. This is basically a side effect of the Docking Manager and MDI child mechanism coexisting in an application. Please let me know if you have any questions. Thanks for your interest in Syncfusion Products. Regards, Vijay

Loader.
Live Chat Icon For mobile
Up arrow icon