protected override void OnMouseDown(MouseEventArgs e)
        {
            base.OnMouseDown(e);

            if ((e.Button & MouseButtons.Left) > 0 && (!ReadOnly))
            {
                if ((!LockPopupInvoke) && ColorBoxPopupForm == null)
                {
                    InvokeDropDown(EventArgs.Empty);
                    ColorBoxPopupForm             = new StiColorBoxPopupForm(this, this.SelectedColor);
                    ColorBoxPopupForm.ClosePopup += new EventHandler(OnClosePopup);

                    Rectangle rect = this.RectangleToScreen(this.ClientRectangle);
                    ColorBoxPopupForm.SetLocation(rect.Left, rect.Top + this.Height + 1, 210, 270);

                    ColorBoxPopupForm.Font = this.Font;
                    ColorBoxPopupForm.ShowPopupForm();

                    ColorBoxPopupForm.TabControl.SelectedIndex =
                        ColorBoxPopupForm.TabControl.SelectedIndex;
                    InvokeDropDown(EventArgs.Empty);
                }
                else
                {
                    LockPopupInvoke = false;
                }
            }
        }
        private void OnClosePopup(object sender, EventArgs e)
        {
            if (ColorBoxPopupForm != null)
            {
                InvokeDropUp(e);
                Color value = ColorBoxPopupForm.SelectedColor;
                if (this.SelectedColor != value)
                {
                    this.SelectedColor = value;
                    InvokeSelectedIndexChanged(EventArgs.Empty);
                }

                ColorBoxPopupForm.Dispose();
                ColorBoxPopupForm = null;
            }
        }
예제 #3
0
        private void OnClosePopup(object sender, EventArgs e)
        {
            if (ColorBoxPopupForm != null)
            {
                this.Pushed = false;
                InvokeDropUp(e);

                Color value = ColorBoxPopupForm.SelectedColor;
                if (this.SelectedColor != value)
                {
                    this.SelectedColor = value;
                }

                ColorBoxPopupForm.Dispose();
                ColorBoxPopupForm = null;
            }
        }