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

How to retrieve the size of a popupMenu

Hi, I want to get the final size of the popupMenu to appear. It''s hosted in a parentBarItem, but not in a popupControlContainer. I just want to display the popupMenu at the top of a button. To achieve this, I need the total height of the popupMenu. How can I do this? Thanks in advance Michael Mann

4 Replies

AD Administrator Syncfusion Team April 27, 2004 09:51 PM UTC

Hi Michael, There is no direct API indicating the size of the PopupMenu. I have contacted the development team for their inputs on this issue and will update you with more information as soon as I hear from them. We appreciate your patience and cooperation. Regards, Guru Patwal Syncfusion, Inc.


MM Michael Mann May 10, 2004 09:46 AM UTC

Hi, any API updates regarding the problem? Regards, Michael


AD Administrator Syncfusion Team May 11, 2004 05:40 PM UTC

Hi Michael, Please refer to the PopupsInDepth sample in the directory ...\Syncfusion\Essential Suite\2.0.5.1\Tools\Samples\Editors Package\PopupControlContainer\Advanced\PopupsInDepth. This shows how a PopupMenu can be displayed at a desired position and with a desired alignment. I have modified the sample to show the PopupMenu on top of the source control. Please refer to the code in GetLocationForPopupAlignment method. public Point GetLocationForPopupAlignment(PopupRelativeAlignment prevAlignment, out PopupRelativeAlignment newAlignment) { Rectangle bounds = this.Bounds; // This utility method takes a rectangle and returns the 8 positions around // it 1 at a time. It will start with the alignment specified in the 3rd argument. Point pos = PopupUtils.ComputeDefaultPopupAlignment(prevAlignment, out newAlignment, PopupRelativeAlignment.TopLeft, PopupRelativeAlignment.TopLeft, bounds); return this.Parent.PointToScreen(pos); } I have attached the modified sample here. Let me know if you need further assistance. We appreciate your continued interest in Syncfusion products. Regards, Guru Patwal Syncfusion, Inc.


MM Michael Mann May 12, 2004 12:18 PM UTC

Thanks for your help - Worked great!

Loader.
Live Chat Icon For mobile
Up arrow icon