this.panel1.Controls.Add(this.dataGridViewX1);
this.panel1.Controls.Add(this.buttonX2);
this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.panel1.Location = new System.Drawing.Point(3, 0);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(1021, 426);
//
// dataGridViewX1
//
this.dataGridViewX1.AllowUserToAddRows = false;
this.dataGridViewX1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
dataGridViewCellStyle9.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
dataGridViewCellStyle9.BackColor = System.Drawing.SystemColors.Control; this.dataGridViewX1.Location = new System.Drawing.Point(3, 32);
this.dataGridViewX1.Name = "dataGridViewX1";
//
// buttonX2
//
this.buttonX2.Location = new System.Drawing.Point(345, 3);
this.buttonX2.Name = "buttonX2";
this.buttonX2.Size = new System.Drawing.Size(75, 23);
this.buttonX2.TabIndex = 3;
this.buttonX2.Text = "保存";pannel1加了一个button,下面加一个datagridview,如何在pannel随着form1大小变化时,datagridview跟着变化呢?比如说下拉扩大pannel,datagridview也向下延伸
this.panel1.Controls.Add(this.buttonX2);
this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.panel1.Location = new System.Drawing.Point(3, 0);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(1021, 426);
//
// dataGridViewX1
//
this.dataGridViewX1.AllowUserToAddRows = false;
this.dataGridViewX1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
dataGridViewCellStyle9.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
dataGridViewCellStyle9.BackColor = System.Drawing.SystemColors.Control; this.dataGridViewX1.Location = new System.Drawing.Point(3, 32);
this.dataGridViewX1.Name = "dataGridViewX1";
//
// buttonX2
//
this.buttonX2.Location = new System.Drawing.Point(345, 3);
this.buttonX2.Name = "buttonX2";
this.buttonX2.Size = new System.Drawing.Size(75, 23);
this.buttonX2.TabIndex = 3;
this.buttonX2.Text = "保存";pannel1加了一个button,下面加一个datagridview,如何在pannel随着form1大小变化时,datagridview跟着变化呢?比如说下拉扩大pannel,datagridview也向下延伸
Controls.Add(panel1);
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));