Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8110185
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T01:39:34+00:00 2026-06-06T01:39:34+00:00

I have included 4 buttons inside a panel. The panel is docked to the

  • 0

I have included 4 buttons inside a panel. The panel is docked to the main window.

When I resize the main window, it doesn’t reposition the 4 buttons with respect to the newly modified window size. I am using VS 2010 Designer view to accomplish this.

Here is the entire code generated from designer.cs

private void InitializeComponent()
{
    this.statusStrip1 = new System.Windows.Forms.StatusStrip();
    this.toolStripStatusLabel1 = new System.Windows.Forms.ToolStripStatusLabel();
    this.TreeDDC = new System.Windows.Forms.TreeView();
    this.BtnPointCtrl = new System.Windows.Forms.Button();
    this.BtnLogic = new System.Windows.Forms.Button();
    this.BtnComm = new System.Windows.Forms.Button();
    this.BtnSystem = new System.Windows.Forms.Button();
    this.panel1 = new System.Windows.Forms.Panel();
    this.statusStrip1.SuspendLayout();
    this.panel1.SuspendLayout();
    this.SuspendLayout();
    // 
    // statusStrip1
    // 
    this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
    this.toolStripStatusLabel1});
    this.statusStrip1.Location = new System.Drawing.Point(0, 445);
    this.statusStrip1.Name = "statusStrip1";
    this.statusStrip1.Size = new System.Drawing.Size(639, 22);
    this.statusStrip1.TabIndex = 0;
    this.statusStrip1.Text = "statusBar";
    // 
    // toolStripStatusLabel1
    // 
    this.toolStripStatusLabel1.Name = "toolStripStatusLabel1";
    this.toolStripStatusLabel1.Size = new System.Drawing.Size(61, 17);
    this.toolStripStatusLabel1.Text = "Status Bar";
    // 
    // TreeDDC
    // 
    this.TreeDDC.Dock = System.Windows.Forms.DockStyle.Left;
    this.TreeDDC.Location = new System.Drawing.Point(0, 0);
    this.TreeDDC.Name = "TreeDDC";
    this.TreeDDC.Size = new System.Drawing.Size(97, 445);
    this.TreeDDC.TabIndex = 1;
    // 
    // BtnPointCtrl
    // 
    this.BtnPointCtrl.Location = new System.Drawing.Point(28, 93);
    this.BtnPointCtrl.Name = "BtnPointCtrl";
    this.BtnPointCtrl.Size = new System.Drawing.Size(202, 86);
    this.BtnPointCtrl.TabIndex = 2;
    this.BtnPointCtrl.Text = "???";
    this.BtnPointCtrl.UseVisualStyleBackColor = true;
    // 
    // BtnLogic
    // 
    this.BtnLogic.Location = new System.Drawing.Point(28, 282);
    this.BtnLogic.Name = "BtnLogic";
    this.BtnLogic.Size = new System.Drawing.Size(202, 86);
    this.BtnLogic.TabIndex = 4;
    this.BtnLogic.Text = "??";
    this.BtnLogic.UseVisualStyleBackColor = true;
    // 
    // BtnComm
    // 
    this.BtnComm.Location = new System.Drawing.Point(307, 93);
    this.BtnComm.Name = "BtnComm";
    this.BtnComm.Size = new System.Drawing.Size(202, 86);
    this.BtnComm.TabIndex = 3;
    this.BtnComm.Text = "??";
    this.BtnComm.UseVisualStyleBackColor = true;
    // 
    // BtnSystem
    // 
    this.BtnSystem.Location = new System.Drawing.Point(307, 282);
    this.BtnSystem.Name = "BtnSystem";
    this.BtnSystem.Size = new System.Drawing.Size(202, 86);
    this.BtnSystem.TabIndex = 5;
    this.BtnSystem.Text = "???";
    this.BtnSystem.UseVisualStyleBackColor = true;
    // 
    // panel1
    // 
    this.panel1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
    this.panel1.Controls.Add(this.BtnSystem);
    this.panel1.Controls.Add(this.BtnComm);
    this.panel1.Controls.Add(this.BtnPointCtrl);
    this.panel1.Controls.Add(this.BtnLogic);
    this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
    this.panel1.Location = new System.Drawing.Point(97, 0);
    this.panel1.Name = "panel1";
    this.panel1.Size = new System.Drawing.Size(542, 445);
    this.panel1.TabIndex = 6;
    // 
    // MainForm
    // 
    this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F);
    this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
    this.ClientSize = new System.Drawing.Size(639, 467);
    this.Controls.Add(this.panel1);
    this.Controls.Add(this.TreeDDC);
    this.Controls.Add(this.statusStrip1);
    this.Name = "MainForm";
    this.Text = "MainForm";
    this.statusStrip1.ResumeLayout(false);
    this.statusStrip1.PerformLayout();
    this.panel1.ResumeLayout(false);
    this.ResumeLayout(false);
    this.PerformLayout();

}

But I believe the only code of interest will be the following:

this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;


this.panel1.Controls.Add(this.BtnSystem);
this.panel1.Controls.Add(this.BtnComm);
this.panel1.Controls.Add(this.BtnPointCtrl);
this.panel1.Controls.Add(this.BtnLogic);

Any help will be greatly appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T01:39:36+00:00Added an answer on June 6, 2026 at 1:39 am

    Use the Anchor property of the buttons…

    Read it Working with Anchoring and Docking

    The Panel does not itself repositioning the controls when it resizing, Use the Anchor (Top, Bottom, Left, Right) property that the controls reposition when parent Panel resizes…

    Or Use TableLayOutPanel.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a .xhtml with two commandlink buttons and two outputpanels. Everything inside same
I have layout included inside another layout , I want this included one aligned
I am writing a GTKmm window program; the main window creates two buttons, one
I have a button inside a from, i included the following code for the
I have included Zend_Form_Element_Hash into a form multiplecheckbox form. I have jQuery set to
I have included Javascript with <%= javascript_include_tag application %> in my Rails 3.2 application.
I have included numerous coldfusion and html files in CFM pages using the <cfinclude>
I have a rails module included for reference below that I have included using
I have a simple ATL Service in which I have included the following statement.
I have inherited a DotNetNuke codebase and have come across areas that have included

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.