Наследование: System.Windows.Forms.PropertyGrid
Пример #1
0
        private void InitializeComponent()
        {
            this.components = new System.ComponentModel.Container();
            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
            this.tabControl1                 = new System.Windows.Forms.TabControl();
            this.tabPage1                    = new System.Windows.Forms.TabPage();
            this.columnProperties            = new MySql.Data.VisualStudio.Editors.VS2005PropertyGrid();
            this.panel1                      = new System.Windows.Forms.Panel();
            this.columnGrid                  = new System.Windows.Forms.DataGridView();
            this.NameColumn                  = new System.Windows.Forms.DataGridViewTextBoxColumn();
            this.TypeColumn                  = new System.Windows.Forms.DataGridViewComboBoxColumn();
            this.AllowNullColumn             = new System.Windows.Forms.DataGridViewCheckBoxColumn();
            this.columnBindingSource         = new System.Windows.Forms.BindingSource(this.components);
            this.dataGridViewTextBoxColumn1  = new System.Windows.Forms.DataGridViewTextBoxColumn();
            this.dataGridViewComboBoxColumn1 = new System.Windows.Forms.DataGridViewComboBoxColumn();
            this.splitter1                   = new MySql.Data.VisualStudio.Editors.MySplitter();
            this.tabControl1.SuspendLayout();
            this.tabPage1.SuspendLayout();
            this.panel1.SuspendLayout();
            ((System.ComponentModel.ISupportInitialize)(this.columnGrid)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.columnBindingSource)).BeginInit();
            this.SuspendLayout();
            //
            // tabControl1
            //
            this.tabControl1.Controls.Add(this.tabPage1);
            this.tabControl1.Dock          = System.Windows.Forms.DockStyle.Fill;
            this.tabControl1.Font          = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.tabControl1.Location      = new System.Drawing.Point(6, 10);
            this.tabControl1.Name          = "tabControl1";
            this.tabControl1.Padding       = new System.Drawing.Point(6, 6);
            this.tabControl1.SelectedIndex = 0;
            this.tabControl1.Size          = new System.Drawing.Size(612, 308);
            this.tabControl1.TabIndex      = 1;
            //
            // tabPage1
            //
            this.tabPage1.BackColor = System.Drawing.SystemColors.Control;
            this.tabPage1.Controls.Add(this.columnProperties);
            this.tabPage1.Location = new System.Drawing.Point(4, 30);
            this.tabPage1.Name     = "tabPage1";
            this.tabPage1.Padding  = new System.Windows.Forms.Padding(3);
            this.tabPage1.Size     = new System.Drawing.Size(604, 274);
            this.tabPage1.TabIndex = 0;
            this.tabPage1.Text     = "Column Properties";
            //
            // columnProperties
            //
            this.columnProperties.Dock                  = System.Windows.Forms.DockStyle.Fill;
            this.columnProperties.Location              = new System.Drawing.Point(3, 3);
            this.columnProperties.Name                  = "columnProperties";
            this.columnProperties.Size                  = new System.Drawing.Size(598, 268);
            this.columnProperties.TabIndex              = 0;
            this.columnProperties.PropertyValueChanged += new System.Windows.Forms.PropertyValueChangedEventHandler(this.columnProperties_PropertyValueChanged);
            //
            // panel1
            //
            this.panel1.BackColor = System.Drawing.SystemColors.Control;
            this.panel1.Controls.Add(this.tabControl1);
            this.panel1.Dock     = System.Windows.Forms.DockStyle.Fill;
            this.panel1.Location = new System.Drawing.Point(0, 103);
            this.panel1.Name     = "panel1";
            this.panel1.Padding  = new System.Windows.Forms.Padding(6, 10, 6, 6);
            this.panel1.Size     = new System.Drawing.Size(624, 324);
            this.panel1.TabIndex = 9;
            //
            // columnGrid
            //
            this.columnGrid.AllowUserToResizeRows         = false;
            this.columnGrid.AutoGenerateColumns           = false;
            this.columnGrid.BackgroundColor               = System.Drawing.SystemColors.Window;
            this.columnGrid.BorderStyle                   = System.Windows.Forms.BorderStyle.None;
            this.columnGrid.ColumnHeadersBorderStyle      = System.Windows.Forms.DataGridViewHeaderBorderStyle.None;
            dataGridViewCellStyle1.Alignment              = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
            dataGridViewCellStyle1.BackColor              = System.Drawing.SystemColors.Control;
            dataGridViewCellStyle1.Font                   = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            dataGridViewCellStyle1.ForeColor              = System.Drawing.SystemColors.WindowText;
            dataGridViewCellStyle1.SelectionBackColor     = System.Drawing.SystemColors.Highlight;
            dataGridViewCellStyle1.SelectionForeColor     = System.Drawing.SystemColors.HighlightText;
            dataGridViewCellStyle1.WrapMode               = System.Windows.Forms.DataGridViewTriState.True;
            this.columnGrid.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle1;
            this.columnGrid.ColumnHeadersHeightSizeMode   = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
            this.columnGrid.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
                this.NameColumn,
                this.TypeColumn,
                this.AllowNullColumn
            });
            this.columnGrid.DataSource                = this.columnBindingSource;
            dataGridViewCellStyle2.Alignment          = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
            dataGridViewCellStyle2.BackColor          = System.Drawing.SystemColors.Window;
            dataGridViewCellStyle2.Font               = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            dataGridViewCellStyle2.ForeColor          = System.Drawing.SystemColors.ControlText;
            dataGridViewCellStyle2.SelectionBackColor = System.Drawing.SystemColors.GradientActiveCaption;
            dataGridViewCellStyle2.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
            dataGridViewCellStyle2.WrapMode           = System.Windows.Forms.DataGridViewTriState.False;
            this.columnGrid.DefaultCellStyle          = dataGridViewCellStyle2;
            this.columnGrid.Dock                   = System.Windows.Forms.DockStyle.Top;
            this.columnGrid.EditMode               = System.Windows.Forms.DataGridViewEditMode.EditProgrammatically;
            this.columnGrid.GridColor              = System.Drawing.SystemColors.ControlLight;
            this.columnGrid.Location               = new System.Drawing.Point(0, 0);
            this.columnGrid.Name                   = "columnGrid";
            this.columnGrid.RowHeadersBorderStyle  = System.Windows.Forms.DataGridViewHeaderBorderStyle.None;
            this.columnGrid.RowHeadersWidth        = 25;
            this.columnGrid.ShowCellErrors         = false;
            this.columnGrid.ShowEditingIcon        = false;
            this.columnGrid.ShowRowErrors          = false;
            this.columnGrid.Size                   = new System.Drawing.Size(624, 103);
            this.columnGrid.TabIndex               = 2;
            this.columnGrid.CellClick             += new System.Windows.Forms.DataGridViewCellEventHandler(this.columnGrid_CellClick);
            this.columnGrid.CellContentClick      += new System.Windows.Forms.DataGridViewCellEventHandler(this.columnGrid_CellContentClick);
            this.columnGrid.CellEnter             += new System.Windows.Forms.DataGridViewCellEventHandler(this.columnGrid_CellEnter);
            this.columnGrid.CellLeave             += new System.Windows.Forms.DataGridViewCellEventHandler(this.columnGrid_CellLeave);
            this.columnGrid.CellValidating        += new System.Windows.Forms.DataGridViewCellValidatingEventHandler(this.columnGrid_CellValidating);
            this.columnGrid.DataError             += new System.Windows.Forms.DataGridViewDataErrorEventHandler(this.columnGrid_DataError);
            this.columnGrid.EditingControlShowing += new System.Windows.Forms.DataGridViewEditingControlShowingEventHandler(this.columnGrid_EditingControlShowing);
            this.columnGrid.UserDeletingRow       += new System.Windows.Forms.DataGridViewRowCancelEventHandler(this.columnGrid_UserDeletingRow);
            //
            // NameColumn
            //
            this.NameColumn.DataPropertyName = "ColumnName";
            this.NameColumn.HeaderText       = "Column Name";
            this.NameColumn.MinimumWidth     = 200;
            this.NameColumn.Name             = "NameColumn";
            this.NameColumn.Width            = 200;
            //
            // TypeColumn
            //
            this.TypeColumn.DataPropertyName = "DataType";
            this.TypeColumn.DisplayStyle     = System.Windows.Forms.DataGridViewComboBoxDisplayStyle.ComboBox;
            this.TypeColumn.DisplayStyleForCurrentCellOnly = true;
            this.TypeColumn.HeaderText = "Data Type";
            this.TypeColumn.Name       = "TypeColumn";
            //
            // AllowNullColumn
            //
            this.AllowNullColumn.DataPropertyName = "AllowNull";
            this.AllowNullColumn.HeaderText       = "Allow Nulls";
            this.AllowNullColumn.Name             = "AllowNullColumn";
            //
            // columnBindingSource
            //
            this.columnBindingSource.AllowNew        = true;
            this.columnBindingSource.DataSource      = typeof(MySql.Data.VisualStudio.DbObjects.Column);
            this.columnBindingSource.CurrentChanged += new System.EventHandler(this.columnBindingSource_CurrentChanged);
            //
            // dataGridViewTextBoxColumn1
            //
            this.dataGridViewTextBoxColumn1.DataPropertyName = "ColumnName";
            this.dataGridViewTextBoxColumn1.HeaderText       = "Column Name";
            this.dataGridViewTextBoxColumn1.Name             = "dataGridViewTextBoxColumn1";
            this.dataGridViewTextBoxColumn1.Width            = 150;
            //
            // dataGridViewComboBoxColumn1
            //
            this.dataGridViewComboBoxColumn1.DataPropertyName = "DataType";
            this.dataGridViewComboBoxColumn1.DisplayStyle     = System.Windows.Forms.DataGridViewComboBoxDisplayStyle.ComboBox;
            this.dataGridViewComboBoxColumn1.DisplayStyleForCurrentCellOnly = true;
            this.dataGridViewComboBoxColumn1.HeaderText = "Data Type";
            this.dataGridViewComboBoxColumn1.Name       = "dataGridViewComboBoxColumn1";
            //
            // splitter1
            //
            this.splitter1.Dock     = System.Windows.Forms.DockStyle.Top;
            this.splitter1.Location = new System.Drawing.Point(0, 103);
            this.splitter1.Name     = "splitter1";
            this.splitter1.Size     = new System.Drawing.Size(624, 6);
            this.splitter1.TabIndex = 10;
            this.splitter1.TabStop  = false;
            //
            // TableEditor
            //
            this.BackColor = System.Drawing.SystemColors.Window;
            this.Controls.Add(this.splitter1);
            this.Controls.Add(this.panel1);
            this.Controls.Add(this.columnGrid);
            this.Font   = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.Margin = new System.Windows.Forms.Padding(0);
            this.Name   = "TableEditor";
            this.Size   = new System.Drawing.Size(624, 427);
            this.tabControl1.ResumeLayout(false);
            this.tabPage1.ResumeLayout(false);
            this.panel1.ResumeLayout(false);
            ((System.ComponentModel.ISupportInitialize)(this.columnGrid)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.columnBindingSource)).EndInit();
            this.ResumeLayout(false);

            _previousDataType = "varchar(45)";
        }
Пример #2
0
    private void InitializeComponent()
    {
      this.components = new System.ComponentModel.Container();
      System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle();
      System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle();
      this.tabControl1 = new System.Windows.Forms.TabControl();
      this.tabPage1 = new System.Windows.Forms.TabPage();
      this.columnProperties = new MySql.Data.VisualStudio.Editors.VS2005PropertyGrid();
      this.panel1 = new System.Windows.Forms.Panel();
      this.columnGrid = new System.Windows.Forms.DataGridView();
      this.NameColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
      this.TypeColumn = new System.Windows.Forms.DataGridViewComboBoxColumn();
      this.AllowNullColumn = new System.Windows.Forms.DataGridViewCheckBoxColumn();
      this.columnBindingSource = new System.Windows.Forms.BindingSource(this.components);
      this.dataGridViewTextBoxColumn1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
      this.dataGridViewComboBoxColumn1 = new System.Windows.Forms.DataGridViewComboBoxColumn();
      this.splitter1 = new MySql.Data.VisualStudio.Editors.MySplitter();
      this.tabControl1.SuspendLayout();
      this.tabPage1.SuspendLayout();
      this.panel1.SuspendLayout();
      ((System.ComponentModel.ISupportInitialize)(this.columnGrid)).BeginInit();
      ((System.ComponentModel.ISupportInitialize)(this.columnBindingSource)).BeginInit();
      this.SuspendLayout();
      // 
      // tabControl1
      // 
      this.tabControl1.Controls.Add(this.tabPage1);
      this.tabControl1.Dock = System.Windows.Forms.DockStyle.Fill;
      this.tabControl1.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
      this.tabControl1.Location = new System.Drawing.Point(6, 10);
      this.tabControl1.Name = "tabControl1";
      this.tabControl1.Padding = new System.Drawing.Point(6, 6);
      this.tabControl1.SelectedIndex = 0;
      this.tabControl1.Size = new System.Drawing.Size(612, 308);
      this.tabControl1.TabIndex = 1;
      // 
      // tabPage1
      // 
      this.tabPage1.BackColor = System.Drawing.SystemColors.Control;
      this.tabPage1.Controls.Add(this.columnProperties);
      this.tabPage1.Location = new System.Drawing.Point(4, 30);
      this.tabPage1.Name = "tabPage1";
      this.tabPage1.Padding = new System.Windows.Forms.Padding(3);
      this.tabPage1.Size = new System.Drawing.Size(604, 274);
      this.tabPage1.TabIndex = 0;
      this.tabPage1.Text = "Column Properties";
      // 
      // columnProperties
      // 
      this.columnProperties.Dock = System.Windows.Forms.DockStyle.Fill;
      this.columnProperties.Location = new System.Drawing.Point(3, 3);
      this.columnProperties.Name = "columnProperties";
      this.columnProperties.Size = new System.Drawing.Size(598, 268);
      this.columnProperties.TabIndex = 0;
      this.columnProperties.PropertyValueChanged += new System.Windows.Forms.PropertyValueChangedEventHandler(this.columnProperties_PropertyValueChanged);
      // 
      // panel1
      // 
      this.panel1.BackColor = System.Drawing.SystemColors.Control;
      this.panel1.Controls.Add(this.tabControl1);
      this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
      this.panel1.Location = new System.Drawing.Point(0, 103);
      this.panel1.Name = "panel1";
      this.panel1.Padding = new System.Windows.Forms.Padding(6, 10, 6, 6);
      this.panel1.Size = new System.Drawing.Size(624, 324);
      this.panel1.TabIndex = 9;
      // 
      // columnGrid
      // 
      this.columnGrid.AllowUserToResizeRows = false;
      this.columnGrid.AutoGenerateColumns = false;
      this.columnGrid.BackgroundColor = System.Drawing.SystemColors.Window;
      this.columnGrid.BorderStyle = System.Windows.Forms.BorderStyle.None;
      this.columnGrid.ColumnHeadersBorderStyle = System.Windows.Forms.DataGridViewHeaderBorderStyle.None;
      dataGridViewCellStyle3.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
      dataGridViewCellStyle3.BackColor = System.Drawing.SystemColors.Control;
      dataGridViewCellStyle3.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
      dataGridViewCellStyle3.ForeColor = System.Drawing.SystemColors.WindowText;
      dataGridViewCellStyle3.SelectionBackColor = System.Drawing.SystemColors.Highlight;
      dataGridViewCellStyle3.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
      dataGridViewCellStyle3.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
      this.columnGrid.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle3;
      this.columnGrid.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
      this.columnGrid.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
            this.NameColumn,
            this.TypeColumn,
            this.AllowNullColumn});
      this.columnGrid.DataSource = this.columnBindingSource;
      dataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
      dataGridViewCellStyle4.BackColor = System.Drawing.SystemColors.Window;
      dataGridViewCellStyle4.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
      dataGridViewCellStyle4.ForeColor = System.Drawing.SystemColors.ControlText;
      dataGridViewCellStyle4.SelectionBackColor = System.Drawing.SystemColors.GradientActiveCaption;
      dataGridViewCellStyle4.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
      dataGridViewCellStyle4.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
      this.columnGrid.DefaultCellStyle = dataGridViewCellStyle4;
      this.columnGrid.Dock = System.Windows.Forms.DockStyle.Top;
      this.columnGrid.EditMode = System.Windows.Forms.DataGridViewEditMode.EditProgrammatically;
      this.columnGrid.GridColor = System.Drawing.SystemColors.ControlLight;
      this.columnGrid.Location = new System.Drawing.Point(0, 0);
      this.columnGrid.Name = "columnGrid";
      this.columnGrid.RowHeadersBorderStyle = System.Windows.Forms.DataGridViewHeaderBorderStyle.None;
      this.columnGrid.RowHeadersWidth = 25;
      this.columnGrid.ShowCellErrors = false;
      this.columnGrid.ShowEditingIcon = false;
      this.columnGrid.ShowRowErrors = false;
      this.columnGrid.Size = new System.Drawing.Size(624, 103);
      this.columnGrid.TabIndex = 2;
      this.columnGrid.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.columnGrid_CellClick);
      this.columnGrid.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.columnGrid_CellContentClick);
      this.columnGrid.CellEnter += new System.Windows.Forms.DataGridViewCellEventHandler(this.columnGrid_CellEnter);
      this.columnGrid.CellLeave += new System.Windows.Forms.DataGridViewCellEventHandler(this.columnGrid_CellLeave);
      this.columnGrid.CellValidating += new System.Windows.Forms.DataGridViewCellValidatingEventHandler(this.columnGrid_CellValidating);
      this.columnGrid.EditingControlShowing += new System.Windows.Forms.DataGridViewEditingControlShowingEventHandler(this.columnGrid_EditingControlShowing);
      this.columnGrid.UserDeletingRow += new System.Windows.Forms.DataGridViewRowCancelEventHandler(this.columnGrid_UserDeletingRow);
      this.columnGrid.DataError += new System.Windows.Forms.DataGridViewDataErrorEventHandler(this.columnGrid_DataError);
      // 
      // NameColumn
      // 
      this.NameColumn.DataPropertyName = "ColumnName";
      this.NameColumn.HeaderText = "Column Name";
      this.NameColumn.MinimumWidth = 200;
      this.NameColumn.Name = "NameColumn";
      this.NameColumn.Width = 200;
      // 
      // TypeColumn
      // 
      this.TypeColumn.DataPropertyName = "DataType";
      this.TypeColumn.DisplayStyle = System.Windows.Forms.DataGridViewComboBoxDisplayStyle.ComboBox;
      this.TypeColumn.DisplayStyleForCurrentCellOnly = true;
      this.TypeColumn.HeaderText = "Data Type";
      this.TypeColumn.Name = "TypeColumn";
      // 
      // AllowNullColumn
      // 
      this.AllowNullColumn.DataPropertyName = "AllowNull";
      this.AllowNullColumn.HeaderText = "Allow Nulls";
      this.AllowNullColumn.Name = "AllowNullColumn";
      // 
      // columnBindingSource
      // 
      this.columnBindingSource.AllowNew = true;
      this.columnBindingSource.DataSource = typeof(MySql.Data.VisualStudio.DbObjects.Column);
      this.columnBindingSource.CurrentChanged += new System.EventHandler(this.columnBindingSource_CurrentChanged);
      // 
      // dataGridViewTextBoxColumn1
      // 
      this.dataGridViewTextBoxColumn1.DataPropertyName = "ColumnName";
      this.dataGridViewTextBoxColumn1.HeaderText = "Column Name";
      this.dataGridViewTextBoxColumn1.Name = "dataGridViewTextBoxColumn1";
      this.dataGridViewTextBoxColumn1.Width = 150;
      // 
      // dataGridViewComboBoxColumn1
      // 
      this.dataGridViewComboBoxColumn1.DataPropertyName = "DataType";
      this.dataGridViewComboBoxColumn1.DisplayStyle = System.Windows.Forms.DataGridViewComboBoxDisplayStyle.ComboBox;
      this.dataGridViewComboBoxColumn1.DisplayStyleForCurrentCellOnly = true;
      this.dataGridViewComboBoxColumn1.HeaderText = "Data Type";
      this.dataGridViewComboBoxColumn1.Name = "dataGridViewComboBoxColumn1";
      // 
      // splitter1
      // 
      this.splitter1.Dock = System.Windows.Forms.DockStyle.Top;
      this.splitter1.Location = new System.Drawing.Point(0, 103);
      this.splitter1.Name = "splitter1";
      this.splitter1.Size = new System.Drawing.Size(624, 6);
      this.splitter1.TabIndex = 10;
      this.splitter1.TabStop = false;
      // 
      // TableEditor
      // 
      this.BackColor = System.Drawing.SystemColors.Window;
      this.Controls.Add(this.splitter1);
      this.Controls.Add(this.panel1);
      this.Controls.Add(this.columnGrid);
      this.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
      this.Margin = new System.Windows.Forms.Padding(0);
      this.Name = "TableEditor";
      this.Size = new System.Drawing.Size(624, 427);
      this.tabControl1.ResumeLayout(false);
      this.tabPage1.ResumeLayout(false);
      this.panel1.ResumeLayout(false);
      ((System.ComponentModel.ISupportInitialize)(this.columnGrid)).EndInit();
      ((System.ComponentModel.ISupportInitialize)(this.columnBindingSource)).EndInit();
      this.ResumeLayout(false);

    }