2010-10-01 3 views
0

HII J'ai une forme dans laquelle il y a une datagridview qui est dans le FlowLayoutPanel et il y a d'autres contrôles tels que le bouton d'une zone de texte au basRedimensionnement dans le FlowLayoutPanel

je dois redimensionner la vue DataGrid Lorsque le formulaire est redimensionné, il ne doit pas remplir tout le formulaire car le bouton et la zone de texte ne doivent pas être affectés. Cependant, j'ai besoin de la grille de données pour remplir la partie maximale de l'écran. .help me plz ...

Répondre

3

Je pense que vous n'avez pas besoin de FlowLayoutPanel à cette fin. Essayez simplement ce code dans votre Designer.cs et dites-moi si cela ressemble à ce que vous voulez.

private void InitializeComponent() 
{ 
    this.dataGridView1 = new System.Windows.Forms.DataGridView(); 
    this.panel1 = new System.Windows.Forms.Panel(); 
    this.textBox1 = new System.Windows.Forms.TextBox(); 
    this.button1 = new System.Windows.Forms.Button(); 
    ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit(); 
    this.panel1.SuspendLayout(); 
    this.SuspendLayout(); 
    // 
    // dataGridView1 
    // 
    this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; 
    this.dataGridView1.Dock = System.Windows.Forms.DockStyle.Fill; 
    this.dataGridView1.Location = new System.Drawing.Point(0, 0); 
    this.dataGridView1.Name = "dataGridView1"; 
    this.dataGridView1.Size = new System.Drawing.Size(520, 406); 
    this.dataGridView1.TabIndex = 0; 
    // 
    // panel1 
    // 
    this.panel1.Controls.Add(this.button1); 
    this.panel1.Controls.Add(this.textBox1); 
    this.panel1.Dock = System.Windows.Forms.DockStyle.Bottom; 
    this.panel1.Location = new System.Drawing.Point(0, 376); 
    this.panel1.Name = "panel1"; 
    this.panel1.Size = new System.Drawing.Size(520, 30); 
    this.panel1.TabIndex = 1; 
    // 
    // textBox1 
    // 
    this.textBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) 
       | System.Windows.Forms.AnchorStyles.Right))); 
    this.textBox1.Location = new System.Drawing.Point(3, 5); 
    this.textBox1.Name = "textBox1"; 
    this.textBox1.Size = new System.Drawing.Size(433, 20); 
    this.textBox1.TabIndex = 0; 
    // 
    // button1 
    // 
    this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); 
    this.button1.Location = new System.Drawing.Point(442, 4); 
    this.button1.Name = "button1"; 
    this.button1.Size = new System.Drawing.Size(75, 23); 
    this.button1.TabIndex = 1; 
    this.button1.Text = "button1"; 
    this.button1.UseVisualStyleBackColor = true; 
    // 
    // FormMain 
    // 
    this.ClientSize = new System.Drawing.Size(520, 406); 
    this.Controls.Add(this.panel1); 
    this.Controls.Add(this.dataGridView1); 
    this.Name = "FormMain"; 
    this.Text = "FormMain"; 
    ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit(); 
    this.panel1.ResumeLayout(false); 
    this.panel1.PerformLayout(); 
    this.ResumeLayout(false); 

} 

private System.Windows.Forms.DataGridView dataGridView1; 
private System.Windows.Forms.Panel panel1; 
private System.Windows.Forms.Button button1; 
private System.Windows.Forms.TextBox textBox1; 
+0

grand merci beaucoup ...... – amk

Questions connexes