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

  • SEARCH
  • Home
  • 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 6688255
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T05:23:01+00:00 2026-05-26T05:23:01+00:00

I have a split container on panel 1 I have added a groupbox, in

  • 0

I have a split container on panel 1 I have added a groupbox, in that groupbox is a flowcontrol which has dynamic number of textboxes, i have set both the groupbox and flowcontrol to dockstyle to fill.
In code i have also set the textboxes to dock style to fill, but they wont resize when i move the splitter, while the parent flowcontrol does resize.

        Label labelInput = new Label();

        TextBox listBoxNewInput = new TextBox();


        listBoxNewInput.Name = ce.ToString();

        labelInput.AutoSize = true;
        labelInput.Font = new Font(labelInput.Font, FontStyle.Bold);



        listBoxNewInput.Multiline = true;
        // Add vertical scroll bars to the TextBox control.
        listBoxNewInput.ScrollBars = ScrollBars.Vertical;
        // Allow the RETURN key in the TextBox control.
        listBoxNewInput.AcceptsReturn = true;
        // Allow the TAB key to be entered in the TextBox control.
        listBoxNewInput.AcceptsTab = true;
        // Set WordWrap to true to allow text to wrap to the next line.
        listBoxNewInput.WordWrap = true;
        listBoxNewInput.Text = ts.ToString();
        //listBoxNewInput.Width = 150;
        listBoxNewInput.MinimumSize = new Size(200,150);
        listBoxNewInput.MaximumSize = new Size(1000, 150);

        listBoxNewInput.Dock = DockStyle.Fill;

        listBoxNewInput.TextChanged += new EventHandler(listBoxNewInput_TextChanged);
        //Add the newly created text box to the list of input text boxes
        inputTextBoxesList.Add(listBoxNewInput);

        //Add the labels and text box to the form

        flowLayoutPanel1.Controls.Add(labelInput);
        flowLayoutPanel1.Controls.Add(listBoxNewInput);

if i try to put controls directly in to spliter panel 1 only the first two controls appear, which do resize when i move the splitter

splitContainer1.Panel1.Controls.Add(labelInput); splitContainer1.Panel1.Controls.Add(listBoxNewInput);

->if the controls when i put them in flow control resize, when i move the splitter that would be good
OR
->All controls appear when i put them directly into the splitter panel 1

  • 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-05-26T05:23:02+00:00Added an answer on May 26, 2026 at 5:23 am

    Based on your comments and what I think you are trying to accomplish, I think you need to replace the FlowLayoutPanel with a TableLayoutPanel because it sounds like you are just stacking one TextBox below another.

    Create a TableLayoutPanel with 1 column and 1 row.

    Here is a working example:

    tableLayoutPanel1.AutoScroll = true;
    tableLayoutPanel1.GrowStyle = TableLayoutPanelGrowStyle.AddRows;
    tableLayoutPanel1.RowStyles.Clear();
    tableLayoutPanel1.RowStyles.Add(new RowStyle(SizeType.Absolute, 150));
    for (int i = 0; i < 4; i++) {
      AddTextBox("TextBox #" + i.ToString());
    }
    
    private void AddTextBox(string info) {
      TextBox tx = new TextBox();
      tx.Multiline = true;
      tx.Text = info;
      tx.ScrollBars = ScrollBars.Vertical;
      tx.WordWrap = true;
      tx.Height = 150;
      tx.Anchor  = AnchorStyles.Left | AnchorStyles.Top | AnchorStyles.Right;
      tableLayoutPanel1.Controls.Add(tx);
    }
    

    Instead of docking, I set the height of the TextBox and then I set the Anchors so that when the SplitPanel resizes, the TextBoxes resize appropriately.

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

Sidebar

Related Questions

Sir, I have a split container in which in right panel i have a
I have a char array in a C application that I have to split
I have two panels that I want to organize onto another panel. I need
I Have a set of choices(options) coming from Database(around 36 records) which I have
Learning .NET: I have a form with a split container, I want to load
I have added a SplitContainer inside another SplitContainer's Panel. Everything redraws fine when the
I want to hide panel2 on a split container and have panel1 utilize the
I have a web app that I would like to split into three pieces.
I have a horizontal split pane that contains a vertical split pane. When the
I have a form that has 2 panels. I'm trying to save the contents

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.