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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T04:48:51+00:00 2026-06-16T04:48:51+00:00

I have a form with a layout control divided in three parts, left, mid

  • 0

I have a form with a layout control divided in three parts, left, mid and right. By default, the right layout control item (which has a couple of grids) is hidden. There’s a button in the form that expands the form to the right to show the two grids. When you click the button again, it hides the right layout control item and changes the size of the form again. The basic functionality is working fine, but I would like to also update the MinimumSize when the user presses the button (so while the form is expanded, the minimum width should be increased). This is my current code:

private void btnExpand_Click(object sender, EventArgs e)
    {
        this.SuspendLayout( );
        switch (lciRight.Visibility)
        {
            case LayoutVisibility.Never:
                LoadGrids();
                lciRight.Visibility = LayoutVisibility.Always;
                this.Width += lciRight.Width;
                this.MinimumSize = new Size(this.Width, this.MinimumSize.Height);
                btnExpand.Text = "<<";
                break;
            case LayoutVisibility.Always:
                lciRight.Visibility = LayoutVisibility.Never;
                this.MinimumSize = new Size(689, this.MinimumSize.Height);
                this.Width -= lciRight.Width;
                btnExpand.Text = ">>";
                break;
            default:
                break;
        }
        this.ResumeLayout();
    }

The problem I’m having is that when the form is already expanded and we click on the button to make it the original size again, the

this.MinimumSize = new Size(689, this.MinimumSize.Height);

line is not updating the MinimumSize correctly. Any idea why?

  • 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-16T04:48:52+00:00Added an answer on June 16, 2026 at 4:48 am

    This is pretty straightforward function.

    Please consider that you should check changes to this property (and any other relevant to layout) after the following line is executed:

      this.ResumeLayout();
    

    Reason is – SuspendLayout() suspends all changes to control layout to increase performance of your application.

    If property still hasn`t changed you most probably override it (set width to 1100) somewhere else

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

Sidebar

Related Questions

I would like to have a form which has a horizontal layout on the
I have a main view which has master layout contains all javascripts, ie jQuery
I have a Jquery post script, which for reasons outside of my control has
I have a form layout that I want to display the label aligned left
Once I have programmed GUI with Java and have used Form Layouts. Form layout
I have a registration form on my layout grid, made out of a stackPanel.
I have to do a user registration form (classical layout with two columns, labels
I have a linear layout with this form <?xml version=1.0 encoding=utf-8?> <LinearLayout xmlns:android=http://schemas.android.com/apk/res/android android:orientation=vertical
I have the following layout in my page (simplified) <h:form> <h:commandButton action=#{bean.save} value=Save/> <rich:tabPanel
I have an application in which a user fills out a form indicating their

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.