Answer the question
In order to leave comments, you need to log in
How to continue executing code after the form is displayed?
I figured out the difference between ShowDialog() and Show().
You need to call the window using the Show() method, but you need to continue executing the code after the Shown event.
deleteWaiting waitForm = new deleteWaiting();
this.Enabled = false;
waitForm.Owner = this;
waitForm.Show();
//здесь проверка показана ли форма?
Thread.Sleep(12350);
MessageBox.Show("test");
Answer the question
In order to leave comments, you need to log in
Alternatively, you can use the Shown event itself, just subscribe to it from the first form:
private void button1_Click(object sender, EventArgs e)
{
var form = new Form1();
form.Shown += form_Shown;
form.Show();
}
void form_Shown(object sender, EventArgs e)
{
MessageBox.Show("Test");
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question