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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T07:04:27+00:00 2026-05-13T07:04:27+00:00

I am sorry if it seems like I am posting the same question. The

  • 0

I am sorry if it seems like I am posting the same question. The problem is similar but I find out more and more about the problem each time. So thanks in advance for all the help. Its much appreciated. 😀

I want to show a form/dialog given a certain condition while inside of a loop. My problem is I have created this segment of code in my program and when I meet my condition and Show my form it doesn’t display properly. I have narrowed the problem down to the loop as it works fine else where in the program. But whenever I try to call the .Show method on my form before the loop starts or inside the loop it doesn’t display properly. Specifically my form/dialog only has a single Label on it at the moment. Here is what happens when I call the .Show method on my form/dialog:

  • Unable to interact (IE move it around or close it with the ‘X’) with the form/dialog – The mouse icon shows that it is thinking/working if you hover of the form/dialog.
  • The background doesn’t load – The border and title bar/header do load for the dialog but the background doesn’t. In fact it isn’t there to start so you can see through the form/dialog. If you click anywhere the background then goes to black.
  • The Label doesn’t load – This probably is related to the background but you can’t see the label or an outline/shading of where it ought to be.

Here is my segment of code:

    private void ConnectSequence(object sender, DoWorkEventArgs e)
    {
        EstablishingConnection ourECF = new EstablishingConnection();

        // Loop till connected
        while (!this.ourCC.Connected)
        {
            this.ourCC.InitializeConnection();

            // If we didn't connect and ourECF isn't already shown then show it
            if (!this.ourCC.Connected && false == ourECF.Visible)
            {
                ourECF.Show();
            }
        }

        ourECF.Dispose();
    }

Here is what I am trying to do:

  • Loop until a connection is made
  • If after the first attempt to connect is a failure display a form/dialog that alerts the user that attempts to establish a connection are being made

The code it self works great. If I turn the server off and run the client application it pops up the form/dialog that doesn’t work properly. When I turn the server back on it gets out of the loop and disposes of the form/dialog. Currently I have a BackgroundWorker calling ConnectSequence as I thought this would solve my problem.

What I have tried so far:

  • Use of threads (System.Threads & BackgroundWorker)
  • Turning its .Visible property to true (.Show does this but gave it a whirl)
  • Instantiated ourECF and called it in as many different places as I could find to see if I could find a work around.

But in the end it doesn’t work because of this loop. And I have no idea why. Any help would be much appreciated. I am so grateful for all your help. 😀

  • 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-13T07:04:28+00:00Added an answer on May 13, 2026 at 7:04 am

    If you already used a BackgroundWorker, what didn’t work with it??

            backgroundWorker.WorkerReportsProgress = true;
    
            backgroundWorker.DoWork += (newSender, newE) =>
            {
                while (!this.ourCC.Connected)
                {
                    this.ourCC.InitializeConnection();
    
                    if (!this.ourCC.Connected)
                    {
                        backgroundWorker.ReportProgress(0, true);
                    }
                }
            };
    
            backgroundWorker.ProgressChanged += (newSender, newE) =>
            {
                if (!ourECF.Visible)
                {
                    ourECF.Show();
                }
            };
    
            backgroundWorker.RunWorkerCompleted += (newSender, newE) =>
            {
                ourECF.Dispose();
            };
    
            backgroundWorker.RunWorkerAsync();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 258k
  • Answers 258k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer You tagged this with ASP.NET and IIS, so I will… May 13, 2026 at 11:04 am
  • Editorial Team
    Editorial Team added an answer note I'm assuming you mean Nullable<T>; if you mean Nullable<T>… May 13, 2026 at 11:04 am
  • Editorial Team
    Editorial Team added an answer You need to get rid of the do from your… May 13, 2026 at 11:04 am

Related Questions

I am trying to verify that a C# string is compliant with XML Schema
I've been slowly working my way through the list of Project Euler problems, and
I am new to C# so I apologize if this is a simple task.
I'll just start out by saying I am not at all experienced with creating
I am trying to place an action to happen after an entire .aspx page

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.