public PropertyGridTextBox()
        {
            dialog_button   = new Button();
            dropdown_button = new Button();
            textbox         = new PGTextBox();

            SuspendLayout();

            dialog_button.Dock      = DockStyle.Right;
            dialog_button.BackColor = SystemColors.Control;
            dialog_button.Size      = new Size(16, 16);
            dialog_button.TabIndex  = 1;
            dialog_button.Visible   = false;
            dialog_button.Click    += new System.EventHandler(dialog_button_Click);

            dropdown_button.Dock      = DockStyle.Right;
            dropdown_button.BackColor = SystemColors.Control;
            dropdown_button.Size      = new Size(16, 16);
            dropdown_button.TabIndex  = 2;
            dropdown_button.Visible   = false;
            dropdown_button.Click    += new System.EventHandler(dropdown_button_Click);

            textbox.AutoSize    = false;
            textbox.BorderStyle = BorderStyle.None;
            textbox.Dock        = DockStyle.Fill;
            textbox.TabIndex    = 3;

            Controls.Add(textbox);
            Controls.Add(dropdown_button);
            Controls.Add(dialog_button);

            SetStyle(ControlStyles.Selectable, true);

            ResumeLayout(false);

            dropdown_button.Paint += new PaintEventHandler(dropdown_button_Paint);
            dialog_button.Paint   += new PaintEventHandler(dialog_button_Paint);
            textbox.DoubleClick   += new EventHandler(textbox_DoubleClick);
            textbox.KeyDown       += new KeyEventHandler(textbox_KeyDown);
            textbox.GotFocus      += new EventHandler(textbox_GotFocus);
        }
Пример #2
0
		public PropertyGridTextBox() {
			dialog_button = new Button();
			dropdown_button = new Button();
			textbox = new PGTextBox ();

			SuspendLayout();

			dialog_button.Dock = DockStyle.Right;
			dialog_button.BackColor = SystemColors.Control;
			dialog_button.Size = new Size(16, 16);
			dialog_button.TabIndex = 1;
			dialog_button.Visible = false;
			dialog_button.Click += new System.EventHandler(dialog_button_Click);

			dropdown_button.Dock = DockStyle.Right;
			dropdown_button.BackColor = SystemColors.Control;
			dropdown_button.Size = new Size(16, 16);
			dropdown_button.TabIndex = 2;
			dropdown_button.Visible = false;
			dropdown_button.Click += new System.EventHandler(dropdown_button_Click);

			textbox.AutoSize = false;
			textbox.BorderStyle = BorderStyle.None;
			textbox.Dock = DockStyle.Fill;
			textbox.TabIndex = 3;

			Controls.Add(textbox);
			Controls.Add(dropdown_button);
			Controls.Add(dialog_button);

			SetStyle (ControlStyles.Selectable, true);

			ResumeLayout(false);

			dropdown_button.Paint+=new PaintEventHandler(dropdown_button_Paint);
			dialog_button.Paint+=new PaintEventHandler(dialog_button_Paint);
			textbox.DoubleClick+=new EventHandler(textbox_DoubleClick);
			textbox.KeyDown+=new KeyEventHandler(textbox_KeyDown);
			textbox.GotFocus+=new EventHandler(textbox_GotFocus);
		}