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

XPmenus and PointToClient

I am trying to position a MDI child window from code in an application that uses XPMenus. I have a point in screen coordinates which I convert with PointToClient. The result is a bit off. It seems that the conversion ignores the space taken up by the XPmenus. Im fairly convinced that this is the reason, since when I dock all the menus (and detached command bars) at the bottom or right, the result is correct. What can I do to avoid this problem?

6 Replies

EP Ebenezer P Syncfusion Team July 28, 2005 09:19 AM

Hi Kjetil, If the space occupied by XPMenus has to be excluded the function Screen.GetWorkingArea should be used to get working area of the display which can then be used to position the form.I have attached a sample that illustrates this.We appreciate your interest in Syncfusion products. Regards, Ebenezer.P XPMenus_9940.zip


AD Administrator Syncfusion Team July 28, 2005 10:50 AM

Hi Ebenezer. Thanks for your feedback. However, unless I have misunderstood something, I don''t think your sample solves the problem. It simply places the child form at Location (0,0). What is needed is a function that converts a set of screen coordinates to a set of client coordinates, accounting for the space taken up by the XP menus. The winforms PointToClient only does the conversion that would be correct if there were no the XP-menus.


AD Administrator Syncfusion Team August 2, 2005 02:12 PM

Hi Kjetil, Thanks for the additional information. I understand your requirements better now. I am afraid, the PointToClient method does not take into account the space occupied by the XPMenus.Bars. We have considered this as a feature request (#321) and will add a new method PointToClientWithMenus to the BarManager for this purpose. You could track the progress of this feature request at this link below : Feature Request #321 - Add support for PointToClientWithMenus method in the BarManager We will try our best to implement the same at the earliest. We appreciate your feedback, and thanks for your patience. Regards, Guru Patwal Syncfusion, Inc.


AD Administrator Syncfusion Team August 3, 2005 10:40 AM

Hi Kjetil, After further investigating this issue, we do see that the child form is indeed positioned correctly by the PointToClient method. However, due to the presence of the scrollbars, it gives an impression of not having the desired effect. Please refer to the test sample attached that illustrates this and let me know your thoughts on this. We appreciate your feedback. Regards, Guru Patwal Syncfusion, Inc.


AD Administrator Syncfusion Team August 5, 2005 06:47 AM

Hi Guru. I tried your last sample and it seemed to work fine with the given position. However, there are some strange things going on. I tried the following: 1. Changed the position to (10,10). 2. Clicked "Child". (This brings up the child form positioned correctly, but because the scroll bar form some reason is brougth up it appears to be positioned wrong.) 3. Repositioned the scroll bar to the top. 4. Repeated 2-3. This brought up a new child, but also the changed the position of the previsous child! Indeed, repeating 2-3 many times gives a series of children, each positioned at a different point. Since there currently seemed to by no straightforward solution to the positioning issue, I have been able to find another solution for my original problem, that does not involve positioning of the child window. The issue is thus not critical to me any longer, but thanks a lot for your effort. P.S. I think it is very important that (the possibly related issue) of arranging the MDI childrent with TileVertical, etc works correctly. Fourtunately this works nicely, taking the XP menus correctly into account.


AD Administrator Syncfusion Team August 8, 2005 04:35 PM

Hi Kjetil, Thanks for the update. I do see this discrepancy in the positioning of the MDI child forms using the PointToClient method. So we will go ahead with feature request 321. Though I am unable to promise you any turnaround time on this, we will try our very best to implement this feature as soon as possible. We appreciate your continued interest in Syncfusion products. Regards, Guru Patwal Syncfusion, Inc.

Loader.
Live Chat Icon For mobile
Up arrow icon