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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T01:50:49+00:00 2026-05-15T01:50:49+00:00

At the beginning of a section of C# code that could take several seconds

  • 0

At the beginning of a section of C# code that could take several seconds to complete, I’d like to display a non modal form with a label that just says, “Please wait…”

WaitForm myWaitForm = null;

try
{
  // if conditions suggest process will take awhile
  myWaitForm = new WaitForm();
  myWaitForm.Show();

  // do stuff
}
finally
{
  if (myWaitForm != null)
  {
    myWaitForm.Hide();
    myWaitForm.Dispose();
    myWaitForm = null;
  }
}

The problem: the WaitForm doesn’t completely display before the rest of the code ties up the thread. So I only see the frame of the form. In Delphi (my old stomping ground) I would call Application.ProcessMessages after the Show() Is there an equivalent in C#? Is there a canned “status” form that I can use in situations like this? Is there a better way to approach this?

Thanks in advance.
David Jennings

  • 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-15T01:50:49+00:00Added an answer on May 15, 2026 at 1:50 am

    i agree on the “other thread” suggestion, but for simple and short purposes Application.DoEvents() will do.

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

Sidebar

Related Questions

I have a section of code in a controller that replaces existing HTML with
I'm attempting to complete section 12.3 of the railstutorial.org tutorial. At the beginning of
I have some code that has been working since it's beginning, well over a
What do I add at the beginning and end of a section of code
This is the beginning of a script that displays thumbnails, worked fine, but I've
I am just beginning to program in Java and I noticed that String is
I have Validation working across a large form (I fire it several times before
I have a filepath that I would like to pull the starting directory job
I have a code that has a large number of malloc s and device-specific
I have the following code that uses Sequence objects to read data from a

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.