상속: ToolStripDropDown
예제 #1
0
        /// <summary>
        /// Shows this Popup on the specified location of the screen
        /// </summary>
        /// <param name="screenLocation"></param>
        public void Show(Point screenLocation)
        {
            if (WrappedDropDown == null)
            {
                ToolStripControlHost host = new ToolStripControlHost(this);
                WrappedDropDown = new RibbonWrappedDropDown
                {
                    AutoClose = RibbonDesigner.Current != null
                };
                WrappedDropDown.Items.Add(host);

                WrappedDropDown.Padding = Padding.Empty;
                WrappedDropDown.Margin  = Padding.Empty;
                host.Padding            = Padding.Empty;
                host.Margin             = Padding.Empty;

                WrappedDropDown.Opening += ToolStripDropDown_Opening;
                WrappedDropDown.Closing += ToolStripDropDown_Closing;
                WrappedDropDown.Closed  += ToolStripDropDown_Closed;
                WrappedDropDown.Size     = Size;
            }
            WrappedDropDown.Show(screenLocation);
            RibbonPopupManager.Register(this);

            OnShowed(EventArgs.Empty);
        }
예제 #2
0
        /// <summary>
        /// Shows this Popup on the specified location of the screen
        /// </summary>
        /// <param name="screenLocation"></param>
        public void Show(Point screenLocation)
        {
            ToolStripControlHost host = new ToolStripControlHost(this);
            WrappedDropDown = new RibbonWrappedDropDown();
            WrappedDropDown.AutoClose = RibbonDesigner.Current != null;
            WrappedDropDown.Items.Add(host);
            
            WrappedDropDown.Padding = Padding.Empty;
            WrappedDropDown.Margin = Padding.Empty;
            host.Padding = Padding.Empty;
            host.Margin = Padding.Empty;

            WrappedDropDown.Opening += new CancelEventHandler(ToolStripDropDown_Opening);
            WrappedDropDown.Closing += new ToolStripDropDownClosingEventHandler(ToolStripDropDown_Closing);
            WrappedDropDown.Closed += new ToolStripDropDownClosedEventHandler(ToolStripDropDown_Closed);
            WrappedDropDown.Size = Size;
            WrappedDropDown.Show(screenLocation);
            RibbonPopupManager.Register(this);

            OnShowed(EventArgs.Empty);
        }