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

前端 未结 7 908
有刺的猬
有刺的猬 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:51

    this has helped me a lot ..... Given me new idea but the example code that i have seen here has some modification required

    here is an simple example in wpf with modification now it is working

    on button click

    paste this code

    if (System.Windows.Forms.MessageBox.Show("are u sure", "delete", System.Windows.Forms.MessageBoxButtons.YesNo, System.Windows.Forms.MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.Yes) { this.Close(); } else { MessageBox.Show("why not to delete"); }

提交回复
热议问题