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.
Unfortunately, activation email could not send to your email. Please try again.

Focus problem with docking or popup windows and XPMenus

Thread ID:

Created:

Updated:

Platform:

Replies:

37607 Nov 28,2005 03:24 AM Dec 1,2005 11:36 PM Windows Forms 5
loading
Tags: Tools
Christian
Asked On November 28, 2005 03:24 AM

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

Vijayanand S [Syncfusion]
Replied On November 29, 2005 09:21 AM

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

Christian
Replied On November 30, 2005 01:26 AM

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 06:11 AM

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

Christian
Replied On November 30, 2005 09:32 AM

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 1, 2005 11:36 PM

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

CONFIRMATION

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.

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.

;