I am a newbie, so it might seems a silly question.

I have a login form which calls other form where it says .. "please wait while it loads".

in form 2 i have a label for that.

Now the problem is that the text for that label doesnot appears until everything is executed in the login_click event.


private void cmdLogin_Click(object sender, EventArgs e)
    frm2 objfrm = new frm2();

    // Manything to execute.

Now it loads form2 but the label text doesnot appears.

I removed frm2.close() and came to know that after it comes out of the cmdLogin_Click function, it the text appears.

I also tried frm2.showdialog(), which loads the text but the code stops at that line and doesnot move to next line in the function cmdLogin_Click.

Is there any solution for this?

Help would be appreciated.

Edited by chintan_1671: n/a

6 Years
Discussion Span
Last Post by chintan_1671

The problem is that "manything to execute" is not allowing the UI thread any time to draw frm2. Put Application.DoEvents(); right after your frm2.Show() command. That should allow the UI thread to finish showing your frm2.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.