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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T20:07:36+00:00 2026-06-09T20:07:36+00:00

At initialization of a form (the main form), it calls another form to get

  • 0

At initialization of a form (the main form), it calls another form to get a bunch of starting input, and then transfers a lot of information:

Form3 getup = new Form3();
getup.Show();
example = getup.example;

However, I need to wait for this new form information to be complete.

Form3 getup = new Form3();
getup.Show();
waitfordone();
example = getup.example;

ATM, I’ve tried using while statements:

Form3 getup = new Form3();
getup.Show();
While(getup.visible=true)Console.WriteLine("waiting");
example = getup.example;

But this causes a hang… that is to say, it runs, then freezes. I suspect this is because the while loop is eating all the processing. So, I tried making a new thread

Form3 getup = new Form3();
Thread t = new Thread(getup.Show());
t.start();
While(getup.visible=false)Console.WriteLine("waiting"); // takes a little bit to open
While(getup.visible=true)Console.WriteLine("waiting"); //waits for close
example = getup.example;

But this also causes it to hang. Perhaps for the same reason. I have looked into autoresetevents.

And I tried:

AutoResetEvent invisible = new AutoResetEvent(false);
Form3 getup = new Form3();
void setup_invisible(object sender, EventArgs e)
{
    if (getup.Visible == false) invisible.Set();
}
public ... {
getup.VisibilityChanged += new EventHandle(setup_Invisible);
getup.show();
invisible.WaitOne();
... }
// and many other variations on this

but alas, it opens form3, closes it (because the thread is done?), and then hangs at invisible.WaitOne();

Can someone please explain how to do this, reading is only making me more confused.

  • 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-09T20:07:38+00:00Added an answer on June 9, 2026 at 8:07 pm

    What you may need is a dialog.

    Form3 getup = new Form3();
    getup.ShowDialog();
    example = getup.example;
    

    This will pause the execution and only continue once the form is closed.

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

Sidebar

Related Questions

I can generate datatable during form initialization.(JSF). Then I want to write javascript for
Is this list-initialization of an array of unknown size valid in C++0x? int main()
Which executes first? Form_Load event or the initialization of components? (C# windows form)
I was wondering about an initialization of the following form: int array[] = {
I'm having some problems with bean initialization. I have an edit form to update
I have a main form with a register and a few subforms. I'm using
I have an application which uses 2 forms, a Main Form and a Splash
Some form initialization issues I was having were traced to the .Designer.cs file overwriting
Ive put my initialization code at form load, since it is not a good
I have a c# form, and the initialization time takes a while (its getting

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.