Quantcast
Viewing all articles
Browse latest Browse all 12583

MessageBox does not disappear after user dismisses it

Hi,

I have a message box that shows a warning to the user when they click some command button. My problem is that after the user clicks "Yes" (he is sure he wants to performs this action), the following code (which is time consuming) is run but the message box remains shown until this function (the click event handler) returns. I've added a screenshot to show the problem.

Here is my code (FixDownloads() is the time consuming operation):

private void simpleButton3_Click(object sender, EventArgs e)
        {
                string title = "Apply updates to database";
                string msg = "You are about to apply updates to the database. This process is both long and not reversible. Are you sure?";
                if (MessageBox.Show(msg, title, MessageBoxButtons.YesNo) != System.Windows.Forms.DialogResult.Yes)
                {
                    return;
                }

                

                FixDownloads();
         }

How can I make the message box disappear completely while FixDownloads() is operating?

Thanks!Image may be NSFW.
Clik here to view.


Viewing all articles
Browse latest Browse all 12583

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>