System.Windows.MessageBox doesn't wait for user input before going poof!

后端 未结 7 1505
轻奢々
轻奢々 2021-01-08 00:56

...and it makes no sense why. T-T

In my Application_Startup event handler I have code that looks kinda like this:

private void Applicati         


        
7条回答
  •  迷失自我
    2021-01-08 01:13

    Try to use an overload that accepts System.Windows.Window parameter and pass Null value to make your MessageBox a top-level window of your application, which is independent of all other windows that may exist. I guess your MessageBox gets owned by splashscreen form. When splashscreen is closed, the framework closes the MessageBox. So making your MessageBox ownerless should do the trick.

提交回复
热议问题