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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Focus problem with docking or popup windows and XPMenus

Thread ID:





37607 Nov 28,2005 08:24 AM UTC Dec 2,2005 04:36 AM UTC WinForms 5
Tags: Tools
Asked On November 28, 2005 08:24 AM UTC

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 this worked fine. However, since I upgraded to version (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


Vijayanand S [Syncfusion]
Replied On 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

Replied On 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

Vijayanand S [Syncfusion]
Replied On 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

Replied On 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

Vijayanand S [Syncfusion]
Replied On 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


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon