GetPreferredSize() public method

Discover the preferred size of the element.
public GetPreferredSize ( ViewLayoutContext context ) : Size
context ComponentFactory.Krypton.Toolkit.ViewLayoutContext Layout context.
return System.Drawing.Size
コード例 #1
0
        /// <summary>
        /// Show the quick access toolbar popup relative to the parent area.
        /// </summary>
        /// <param name="parentScreenRect">Screen rectangle of the parent.</param>
        /// <param name="finishDelegate">Delegate fired when popup dismissed.</param>
        public void ShowCalculatingSize(Rectangle parentScreenRect,
                                        EventHandler finishDelegate)
        {
            Size popupSize;

            // Find the size the quick access toolbar requests to be
            using (ViewLayoutContext context = new ViewLayoutContext(this, Renderer))
                popupSize = _viewQAT.GetPreferredSize(context);

            DismissedDelegate = finishDelegate;

            // Request we be shown below the parent screen rect
            Show(parentScreenRect, popupSize);
        }