Exemplo n.º 1
0
        /// <summary>
        /// Selects the item when in a dropdown, in design mode
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void RibbonItem_Click(object sender, EventArgs e)
        {
            RibbonDropDown dd = Canvas as RibbonDropDown;

            if (dd != null && dd.SelectionService != null)
            {
                dd.SelectionService.SetSelectedComponents(
                    new Component[] { this }, System.ComponentModel.Design.SelectionTypes.Primary);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Shows the DropDown
        /// </summary>
        public void ShowDropDown()
        {
            OnDropDownShowing(EventArgs.Empty);

            AssignHandlers();

            RibbonDropDown dd = new RibbonDropDown(this, DropDownItems, Owner);

            dd.ShowSizingGrip = DropDownResizable;
            dd.Closed        += new EventHandler(DropDown_Closed);
            dd.Show(Owner.PointToScreen(new Point(TextBoxBounds.Left, Bounds.Bottom)));
        }
Exemplo n.º 3
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;
            Point location = Canvas.PointToScreen(new Point(Bounds.Left, Bounds.Top));


            SetDropDownVisible(true);
            _dropDown.Show(location);
        }
Exemplo n.º 4
0
 /// <summary>
 /// Creates the DropDown menu
 /// </summary>
 protected virtual void CreateDropDown()
 {
     _dropDown = new RibbonDropDown(this, DropDownItems, Owner);
 }