how to set wpf MessageBox.Owner to desktop window because SplashScreen closes MessageBox

前端 未结 7 811
有刺的猬
有刺的猬 2020-12-16 00:30

I am using the SplashScreen feature in WPF by setting a bitmap\'s Build Action to Splashscreen. Behind the splash screen, licensing informa

相关标签:
7条回答
  • 2020-12-16 00:52

    This is not directly related to the OP's situation, but might be useful for others who are having problems with MessageBox being hidden behind other windows in certain special situations.

    As @dthrasher mentions, one solution is to use a hidden dummy window. But sometimes even that is not enough. I had a situation where the solution was to not only use a hidden dummy window, but to turn on its TopMost property whenever I used it with MessageBox.

         _formKludge.TopMost = true;
    
         MessageBox.Show(_formKludge, "Nice informative message.", "Super-duper Program",
                         MessageBoxButtons.OK, MessageBoxIcon.Error);
    
         _formKludge.TopMost = false;
    
    0 讨论(0)
提交回复
热议问题