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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T16:49:22+00:00 2026-06-09T16:49:22+00:00

I have a Winforms Application with a TabStrip Control. During runtime, UserControls are to

  • 0

I have a Winforms Application with a TabStrip Control. During runtime, UserControls are to be loaded into different tabs dynamically.

I want to present a “User Control xyz is loading” message to the user (setting an existing label to visible and changing its text) before the UserControl is loaded and until the loading is completely finished.

My approaches so far:

  1. Trying to load the User Control in a BackgroundWorker thread. This fails, because I have to access Gui-Controls during the load of the UserControl
  2. Trying to show the message in a BackgroundWorker thread. This obviously fails because the BackgroundWorker thread is not the UI thread 😉
  3. Show the Message, call DoEvents(), load the UserControl. This leads to different behaviour (flickering, …) everytime I load a UserControl, and I can not control when and how to set it to invisible again.

To sum it up, I have two questions:

  1. How to ensure the message is visible directly, before loading the User control
  2. How to ensure the message is set to invisible again, just in the moment the UserControl is completely loaded (including all DataBindings, grid formattings, etc.)
  • 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-09T16:49:24+00:00Added an answer on June 9, 2026 at 4:49 pm

    what we use is similar to this:

    1. create a new form that has whatever you want to show the user,
    2. implement a static method where you can call this form to be created inside itself, to prevent memory leaks
    3. create a new thread within this form so that form is running in a seperated thread and stays responsive; we use an ajax control that shows a progress bar filling up.

    within the method you use to start the thread set its properties to topmost true to ensure it stays on top.

    for instance do this in your main form:

    loadingForm.ShowLoadingScreen("usercontrollname");
    //do something
    loadingform.CloseLoadingScreen();
    

    in the loading form class;

    public LoadingScreen()
    {
      InitializeComponent();
    }
    
    public static void ShowLoadingScreen(string usercontrollname)
    {
      // do something with the usercontroll name if desired
      if (_LoadingScreenThread == null)
      {
        _LoadingScreenThread = new Thread(new ThreadStart(DoShowLoadingScreen));
        _LoadingScreenThread.IsBackground = true;
        _LoadingScreenThread.Start();
      }
    }
    
    public static void CloseLoadingScreen()
    {
      if (_ls.InvokeRequired)
      {
        _ls.Invoke(new MethodInvoker(CloseLoadingScreen));
      }
      else
      {
        Application.ExitThread();
        _ls.Dispose();
        _LoadingScreenThread = null;
      }
    }
    
    private static void DoShowLoadingScreen()
    {
        _ls = new LoadingScreen();
        _ls.FormBorderStyle = FormBorderStyle.None;
        _ls.MinimizeBox = false;
        _ls.ControlBox = false;
        _ls.MaximizeBox = false;
        _ls.TopMost = true;
        _ls.StartPosition = FormStartPosition.CenterScreen;
    
      Application.Run(_ls);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a WinForms application, with login form, and I want to store the
I have a WinForms application. Application has menustrip, toolstrip and several panels. I want
I have a WinForms application in C# and I want to download several files
I have a winforms application that populates an scrollable area with several UserControls. My
I have a WinForms application with a user control in which I change the
I have a WinForms Application that I want to run at Mono at some
I have a winforms application that I want to display an icon, and display
i have a winforms application. i have a user control with a lot of
i have a winforms application and i want to export data from the datagridview
I have a WinForms application in which I want to be able to provide

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.