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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T02:20:41+00:00 2026-05-17T02:20:41+00:00

My application has the following UI configuration: The main form is an MDI container.

  • 0

My application has the following UI configuration:

The main form is an MDI container. Its child forms are attached to a TabStrip.

Each user has his set of child forms. Depending on the active user, only that user’s child forms are displayed, together with tabs.

This is achieved by going through the main form’s MdiChildren and setting their Visible property to false/true depending on the active user.

        foreach (Form item in MdiChildren)
        {
            if (((OfficeFormEx)item).UserID == (int)e.NewTab.Tag)
            {
                item.Visible = true;
            }
            else
            {
                item.Visible = false;
            }
        }

This has two undesired effects. One is that every child form gets redrawn in succession, which is ugly and slow. The other is that for some reason the forms go from maximized to normal, effectively undocking them from the main form.

Is there any way to display just one of the child forms, such as the one the user was previously looking at, and get the others to stay in the background? The maximize/normal thing is not that big a deal because I can maximize them again manually.

  • 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-17T02:20:42+00:00Added an answer on May 17, 2026 at 2:20 am

    I eventually solved this one so here’s a belated write-up.

    Will Marcouiller suggested SuspendLayout() and ResumeLayout(), which did not work. This led me to investigate what these two methods actually do and reach the conclusion that what I needed was a way to stop the main form from redrawing while operations on the MDI children were in progress.

    This in turn resulted in the following two static utility methods which suspend redrawing for a given control. In my case, suspending redrawing of the main form resulted in a massive speed up.

    /// <summary>
    /// suspends drawing on a control and its children
    /// </summary>
    /// <param name="parent"></param>
    public static void SuspendDrawing(Control control)
    {
        SendMessage(control.Handle, WM_SETREDRAW, false, 0);
    }
    
    /// <summary>
    /// resumes drawing on a control and its children
    /// </summary>
    /// <param name="parent"></param>
    public static void ResumeDrawing(Control control)
    {
        SendMessage(control.Handle, WM_SETREDRAW, true, 0);
        control.Refresh();
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My android application has several warnings of the following form when I run it
In my asp.net web application, I'm using asp.net forms authentication with following configuration. <authentication
My application has the following entities: public class User { public virtual int UserID
My application has the following patterns: a FrontController, Command, Service, and DAO. The problem
I'm developing Django application, and I have following error 'Category' object has no attribute
I'm building WPF client application. I'm following MVC pattern. The project solution has many
My application has a need to let the user choose a date from a
My application has no forms. It runs by calling Application.Run();
I want to assemble a web module which looks like the following: src/main/java (has
I have the following projects: MVC Console application Class library Windows forms application COM

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.