Example #1
0
        /// <summary>
        ///     Shows the DropDown
        /// </summary>
        public virtual void ShowDropDown()
        {
            if (!_DropDownVisible)
            {
                AssignHandlers();

                OnDropDownShowing(EventArgs.Empty);

                var dd = new RibbonDropDown(this, DropDownItems, Owner);
                dd.DropDownMaxHeight = _dropDownMaxHeight;
                dd.ShowSizingGrip    = DropDownResizable;
                dd.DrawIconsBar      = _iconsBar;
                dd.Closed           += DropDown_Closed;
                var location = OnGetDropDownMenuLocation();
                dd.Show(location);
                _DropDownVisible = true;
            }
        }
Example #2
0
        /// <summary>
        ///     Shows the drop down items of the button, as if the dropdown part has been clicked
        /// </summary>
        public void ShowDropDown()
        {
            if (DropDownItems.Count == 0)
            {
                SetPressed(false);
                return;
            }

            IgnoreDeactivation();

            _dropDown = new RibbonDropDown(this, DropDownItems, Owner);
            //_dropDown.FormClosed += new FormClosedEventHandler(dropDown_FormClosed);
            //_dropDown.StartPosition = FormStartPosition.Manual;
            _dropDown.ShowSizingGrip = true;
            var location = Canvas.PointToScreen(new Point(Bounds.Left, Bounds.Top));

            SetDropDownVisible(true);
            _dropDown.Show(location);
        }