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 5948233
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T17:04:43+00:00 2026-05-22T17:04:43+00:00

Using WinForms in C#, I’m struggling to get an embedded user control to resize

  • 0

Using WinForms in C#, I’m struggling to get an embedded user control to resize correctly. I can add it to the panel with no issue, and the panel resizes as I expect (and want) it to.

To add the UserControl, I’m doing the following:

content.Controls.RemoveAt(0);
content.Controls.Add(c);
content.Controls[0].Dock = DockStyle.Fill;
content.Refresh();

I cannot figure out how to get the newly added control to resize properly, I’ve also tried using Anchor with Top,Bottom,Left,Right but to no avail. Any help would be appreciated, thanks.

  • 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-22T17:04:43+00:00Added an answer on May 22, 2026 at 5:04 pm

    Adding below will resize the user control with the parent control size.

    this.Dock = DockStyle.Fill; 
    

    But, if you want to resize the child controls of your user control you will have to set their dock values and anchor values properly. Otherwise, the main user control will resize but the inner child controls of the user control will stay as they are.

    You have said;

    << the control moves down, instead of resizing down

    If there are some child controls that you want to stretch vertically you might try FlowLayout panel.

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

Sidebar

Related Questions

I'm developing automation program using winforms webbrowser control. I am able to get the
Using WinForms I am coding a Component user control where I would like it
I'm using a winforms webbrowser control to display some content in a windows forms
I am developing an app using WinForms and the RichTextBox control. This control allows
I'm trying to create an auto-updating app using Winforms. I can't use click-once or
I'm using winforms and i'm pretty new to it, can any one help me
button code DataGridViewButtonColumn btn = new DataGridViewButtonColumn(); dataGridView1.Columns.Add(btn); I'm using WinForms App, here this
Using Winforms, is there a way to allow resize, but only to allow the
I'm using winforms and vb.net. When I right click on a textbox I get
(Using WinForms and C#. -> .Net 2.0) I am adding nodes to a TreeView

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.