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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T11:36:38+00:00 2026-06-11T11:36:38+00:00

If I take my C# form (WinForms) and make it not visible: MyForm.Visible =

  • 0

If I take my C# form (WinForms) and make it not visible:

MyForm.Visible = false;

and then in a separate thread that I create; the following code executes:

        this.Invoke(new MethodInvoker(delegate()
                                          {
                                              ProgressBar2.Visible = false;
                                          }));

My application will just freeze and not continue. If MyForm is visible, the above code in the thread runs fine. If it is not visible, the code stops running as soon as it reads the “this.Invoke(new MethodInvoker(delegate()” line. It does not error out, it just sits there (I set a breakpoint to watch it and it just sits there after the “this.Invoke(new MethodInvoker(delegate()”).

Any idea as to why this will not execute when my form is hidden? And how I can get around this problem? I am using “this.Invoke(new MethodInvoker(delegate()” because I need to be able to set a Progress Bar control on the MainForm as visible (and I must do this on another thread than the main UI thread) and I want to do that regardless if the form is visible or not.

  • 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-11T11:36:40+00:00Added an answer on June 11, 2026 at 11:36 am

    When the form is hidden, I believe the message pump is no longer running. I do know that the Invoke mechanism requires the message pump to be running.

    You might be able to work around the issue by setting the opacity to 0 instead of visibility, tho this has its own issues.

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

Sidebar

Related Questions

Can I create a control that has 2 menu's characteristic: Do not take form's
I'm trying to use urlretrieve to download files from urls that take the form:
I have a listview control that is on a winforms form. It fills the
I have a Winforms application that the user uses to take a region based
How do I take a form that is currently minimized and restore it to
I am writing a script that will take some form data and present it
Lets take an example of WinForms applcation and making invoice. On the Invoice form
I want to take HTML form data and handle the submited data(string for example)
I am trying to take one form type and display it however times i
I'd like to take my form below, and somehow adjust it to submit the

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.