Esempio n. 1
0
        public PropertyGridView(PropertyGrid propertyGrid)
        {
            property_grid = propertyGrid;

            string_format             = new StringFormat();
            string_format.FormatFlags = StringFormatFlags.NoWrap;
            string_format.Trimming    = StringTrimming.None;

            grid_textbox = new PropertyGridTextBox();
            grid_textbox.DropDownButtonClicked += new EventHandler(DropDownButtonClicked);
            grid_textbox.DialogButtonClicked   += new EventHandler(DialogButtonClicked);

            dropdown_form = new PropertyGridDropDown();
            dropdown_form.FormBorderStyle = FormBorderStyle.None;
            dropdown_form.StartPosition   = FormStartPosition.Manual;
            dropdown_form.ShowInTaskbar   = false;

            dialog_form = new Form();
            dialog_form.StartPosition   = FormStartPosition.Manual;
            dialog_form.FormBorderStyle = FormBorderStyle.None;
            dialog_form.ShowInTaskbar   = false;

            dropdown_form_padding = new Padding(0, 0, 2, 2);

            row_height = Font.Height + font_height_padding;

            grid_textbox.Visible      = false;
            grid_textbox.Font         = this.Font;
            grid_textbox.BackColor    = SystemColors.Window;
            grid_textbox.Validate    += new CancelEventHandler(grid_textbox_Validate);
            grid_textbox.ToggleValue += new EventHandler(grid_textbox_ToggleValue);
            grid_textbox.KeyDown     += new KeyEventHandler(grid_textbox_KeyDown);
            this.Controls.Add(grid_textbox);

            vbar               = new ImplicitVScrollBar();
            vbar.Visible       = false;
            vbar.Value         = 0;
            vbar.ValueChanged += new EventHandler(VScrollBar_HandleValueChanged);
            vbar.Dock          = DockStyle.Right;
            this.Controls.AddImplicit(vbar);

            resizing_grid = false;

            bold_font           = new Font(this.Font, FontStyle.Bold);
            inactive_text_brush = new SolidBrush(ThemeEngine.Current.ColorGrayText);

            ForeColorChanged += new EventHandler(RedrawEvent);
            BackColorChanged += new System.EventHandler(RedrawEvent);
            FontChanged      += new EventHandler(RedrawEvent);

            SetStyle(ControlStyles.Selectable, true);
            SetStyle(ControlStyles.DoubleBuffer, true);
            SetStyle(ControlStyles.UserPaint, true);
            SetStyle(ControlStyles.AllPaintingInWmPaint, true);
            SetStyle(ControlStyles.ResizeRedraw, true);
        }
Esempio n. 2
0
		public PropertyGridView (PropertyGrid propertyGrid) {
			property_grid = propertyGrid;

			string_format = new StringFormat ();
			string_format.FormatFlags = StringFormatFlags.NoWrap;
			string_format.Trimming = StringTrimming.None;

			grid_textbox = new PropertyGridTextBox ();
			grid_textbox.DropDownButtonClicked +=new EventHandler (DropDownButtonClicked);
			grid_textbox.DialogButtonClicked +=new EventHandler (DialogButtonClicked);

			dropdown_form = new PropertyGridDropDown ();
			dropdown_form.FormBorderStyle = FormBorderStyle.None;
			dropdown_form.StartPosition = FormStartPosition.Manual;
			dropdown_form.ShowInTaskbar = false;

			dialog_form = new Form ();
			dialog_form.StartPosition = FormStartPosition.Manual;
			dialog_form.FormBorderStyle = FormBorderStyle.None;
			dialog_form.ShowInTaskbar = false;

			dropdown_form_padding = new Padding (0, 0, 2, 2);

			row_height = Font.Height + font_height_padding;

			grid_textbox.Visible = false;
			grid_textbox.Font = this.Font;
			grid_textbox.BackColor = SystemColors.Window;
			grid_textbox.Validate += new CancelEventHandler (grid_textbox_Validate);
			grid_textbox.ToggleValue+=new EventHandler (grid_textbox_ToggleValue);
			grid_textbox.KeyDown+=new KeyEventHandler (grid_textbox_KeyDown);
			this.Controls.Add (grid_textbox);

			vbar = new ImplicitVScrollBar ();
			vbar.Visible = false;
			vbar.Value = 0;
			vbar.ValueChanged+=new EventHandler (VScrollBar_HandleValueChanged);
			vbar.Dock = DockStyle.Right;
			this.Controls.AddImplicit (vbar);

			resizing_grid = false;

			bold_font = new Font (this.Font, FontStyle.Bold);
			inactive_text_brush = new SolidBrush (ThemeEngine.Current.ColorGrayText);

			ForeColorChanged+=new EventHandler (RedrawEvent);
			BackColorChanged+=new System.EventHandler (RedrawEvent);
			FontChanged+=new EventHandler (RedrawEvent);
			
			SetStyle (ControlStyles.Selectable, true);
			SetStyle (ControlStyles.DoubleBuffer, true);
			SetStyle (ControlStyles.UserPaint, true);
			SetStyle (ControlStyles.AllPaintingInWmPaint, true);
			SetStyle (ControlStyles.ResizeRedraw, true);
		}