Beispiel #1
0
        protected virtual void OnSplitClick(SplitMenuEventArgs e)
        {
            SplitClick?.Invoke(this, e);

            if (SplitMenu == null && SplitMenuStrip == null)
            {
                return;
            }

            SplitMenuOpening?.Invoke(this, e);

            if (e.PreventOpening)
            {
                return;
            }

            var pBottomLeft = new System.Drawing.Point(e.DrawArea.Left, e.DrawArea.Bottom);

            if (SplitMenu != null)
            {
                SplitMenu.Show(this, pBottomLeft);
            }
            else if (SplitMenuStrip != null)
            {
                SplitMenuStrip.Width = e.DrawArea.Width;
                SplitMenuStrip.Show(this, pBottomLeft);
            }
        }
Beispiel #2
0
        /// <summary>
        /// Raises the <see cref="E:SplitClick" /> event.
        /// </summary>
        /// <param name="e">The <see cref="SplitMenuEventArgs"/> instance containing the event data.</param>
        protected virtual void OnSplitClick(SplitMenuEventArgs e)
        {
            if (SplitMenuStrip != null)
            {
                if (showingDropdown)
                {
                    //SplitMenuStrip.Close();
                }
                else
                {
                    SplitMenuOpening?.Invoke(this, e);

                    if (!e.PreventOpening)
                    {
                        SplitMenuStrip.Width = e.DrawArea.Width;
                        showingDropdown      = true;
                        SplitMenuStrip.Show(this, new Point(e.DrawArea.Left, e.DrawArea.Bottom));
                    }
                }
            }

            SplitClick?.Invoke(this, e);
        }