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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T08:15:37+00:00 2026-05-16T08:15:37+00:00

I am making a c# windows app that has one MainForm and many User

  • 0

I am making a c# windows app that has one MainForm and many User Controls (LoginPage, HomePage, MyListPage, etc.) embedded inside it. I am using Visual Studio 2005 to design the GUI.

In MainForm’s constructor I do:

Controls.Add(new LoginPage());
Controls.Add(new HomePage());
Controls.Add(new MyListPage());
...
LoginPage.show();

But I have over 30 pages that I add to MainForm’s constructor and I think this is the culprit of my app’s lag at its runtime. Does anybody know a more standardized way of using User Controls for a one-form navigation app?

  • 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-16T08:15:38+00:00Added an answer on May 16, 2026 at 8:15 am

    I’m assuming you have a way of navigating between pages – your user controls aren’t all shown at once?

    If that’s the case, you should be able to do the following:

    1. Create one of the user controls on construction to use as the initial page.
    2. When the user performs an action which means your app should move to another page, remove the current user control from the form, dispose of it, create a new one of the required type, and add it to the form.

    If you only want to create each user control once, you can use a caching mechanism so that each one is only created once (and don’t dispose of the controls as you remove them).

    If you use this approach, it should get rid of some of the initial lag, and trade it for multiple smaller lags as the user navigates to each user control for the first time.

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

Sidebar

Related Questions

I am making an app that scrolls information on the desktop. The window is
I'm making another app's window topmost to ensure that a click in my app
I'm making a program which the user build directories (not in windows, in my
I am making a small app that deletes log files. I am using an
I'm making an app for windows phone 7 (using Visual Studio 2010 Express for
After making a few modifications to a rails app I am tinkering on, railroad
On windows, each thread has a message queue, and each message queue will process
I'm building a centralized desktop application using Python/wxPython. One of the requirements is User
I'm making an html autorun, loading it with default browser has lots of issues,
I have a WPF app that uses Flash10c.ocx developed on a 32 bit machine.

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.