コード例 #1
0
        public void HideDropDown()
        {
            if (this.dropdown == null)
            {
                return;
            }
            if (!this.dropdown.Disposing && !this.dropdown.IsDisposed)
            {
                this.dropdown.Dispose();
            }
            this.dropdown = null;

            this.EmitInvalidate();
        }
コード例 #2
0
        public void ShowDropDown()
        {
            if (this.dropdown != null)
            {
                return;
            }
            if (this.ReadOnly)
            {
                return;
            }
            PropertyGrid parentGrid = this.Parent.ParentGrid;

            this.dropdown = new MultiComboBoxDropDown(this.dropdownItems);
            for (int i = 0; i < this.dropdown.Items.Count; i++)
            {
                this.dropdown.SetItemChecked(i, this.selectedObjects.Contains(this.dropdown.Items[i]));
            }

            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.Parent.Width - this.rect.Width;

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

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

            this.EmitInvalidate();
        }
コード例 #3
0
		public void HideDropDown()
		{
			if (this.dropdown == null) return;
			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 MultiComboBoxDropDown(this.dropdownItems);
			for (int i = 0; i < this.dropdown.Items.Count; i++)
				this.dropdown.SetItemChecked(i, this.selectedObjects.Contains(this.dropdown.Items[i]));

			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.Parent.Width - this.rect.Width;

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

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

			this.EmitInvalidate();
		}