public void ShowDropDown()
        {
            if (this.dropdown != null)
            {
                return;
            }
            if (this.ReadOnly)
            {
                return;
            }
            PropertyGrid parentGrid = this.Parent.ParentGrid;

            this.dropdown = new ComboBoxDropDown(this.dropdownItems);
            this.dropdown.SelectedItem = this.selectedObject;

            Size dropDownSize = new Size(
                this.rect.Width,
                Math.Min(this.dropdownHeight, this.dropdown.PreferredHeight));

            Point dropDownLoc = parentGrid.GetEditorLocation(this.Parent, true);

            //dropDownLoc = parentGrid.PointToScreen(dropDownLoc);
            dropDownLoc.Y += this.rect.Height + 1;
            dropDownLoc.X += this.rect.X;

            this.dropdown.Location         = dropDownLoc;
            this.dropdown.Size             = dropDownSize;
            this.dropdown.AcceptSelection += this.dropdown_AcceptSelection;
            this.dropdown.RequestClose    += this.dropdown_RequestClose;

            this.popupControl.Show(parentGrid, this.dropdown, dropDownLoc.X, dropDownLoc.Y, dropDownSize.Width, dropDownSize.Height, PopupResizeMode.None);

            this.EmitInvalidate();
        }
        public void HideDropDown()
        {
            if (this.popupControl.Visible)
            {
                this.popupControl.Hide();
            }

            if (this.dropdown != null)
            {
                if (!this.dropdown.Disposing && !this.dropdown.IsDisposed)
                {
                    this.dropdown.Dispose();
                }
                this.dropdown = null;
            }

            this.EmitInvalidate();
        }
Пример #3
0
        public void HideDropDown()
        {
            if (this.popupControl.Visible)
                this.popupControl.Hide();

            if (this.dropdown != null)
            {
                if (!this.dropdown.Disposing && !this.dropdown.IsDisposed)
                    this.dropdown.Dispose();
                this.dropdown = null;
            }

            this.EmitInvalidate();
        }
Пример #4
0
        public void ShowDropDown()
        {
            if (this.dropdown != null) return;
            if (this.ReadOnly) return;
            PropertyGrid parentGrid = this.Parent.ParentGrid;

            this.dropdown = new ComboBoxDropDown(this.dropdownItems);
            this.dropdown.SelectedItem = this.selectedObject;

            Size dropDownSize = new Size(
                this.rect.Width,
                Math.Min(this.dropdownHeight, this.dropdown.PreferredHeight));

            Point dropDownLoc = parentGrid.GetEditorLocation(this.Parent, true);
            //dropDownLoc = parentGrid.PointToScreen(dropDownLoc);
            dropDownLoc.Y += this.rect.Height + 1;
            dropDownLoc.X += this.rect.X;

            this.dropdown.Location = dropDownLoc;
            this.dropdown.Size = dropDownSize;
            this.dropdown.AcceptSelection += this.dropdown_AcceptSelection;
            this.dropdown.RequestClose += this.dropdown_RequestClose;

            this.popupControl.Show(parentGrid, this.dropdown, dropDownLoc.X, dropDownLoc.Y, dropDownSize.Width, dropDownSize.Height, PopupResizeMode.None);

            this.EmitInvalidate();
        }