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

How to retrieve the size of a popupMenu

Thread ID:





13356 Apr 27,2004 11:41 AM UTC May 12,2004 12:18 PM UTC WinForms 4
Tags: Tools
Michael Mann
Asked On April 27, 2004 11:41 AM UTC

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

Administrator [Syncfusion]
Replied On 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.

Michael Mann
Replied On May 10, 2004 09:46 AM UTC

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

Administrator [Syncfusion]
Replied On May 11, 2004 05:40 PM UTC

Hi Michael, Please refer to the PopupsInDepth sample in the directory ...\Syncfusion\Essential Suite\\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.

Michael Mann
Replied On May 12, 2004 12:18 PM UTC

Thanks for your help - Worked great!


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

Live Chat Icon For mobile
Live Chat Icon