C# WPF子窗口(关于窗口)
我有一个正在开发的 C#/WPF 应用程序...我有一个名为 About
的 btn,它应该打开一个新窗口,其中包含有关应用程序或我将放入其中的任何内容的详细信息。
当我单击 btn 时,会打开一个新窗口(关于),当我再次单击时,当新窗口(关于)打开时,会打开另一个窗口,如何防止这种情况发生,我也希望在以下情况下禁用该应用程序About
窗口打开并在About
窗口关闭时启用,就像单击“about”时的大多数应用程序一样。
I have an application on C#/WPF that I`m developing ... I have a btn named About
which should open a new window that contains details about the application or whatever I will put in it.
When I click the btn, a new window (about) opens, when I click again, while the new window (about) is opened another one is opened, how can I prevent this from happening, I also want the application to be disabled when the About
window is opened and to be enabled when the About
window is closed, Like most of the applications when about is clicked.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您应该使用 ShowDialog 方法:http://msdn。 microsoft.com/en-us/library/system.windows.window.showdialog.aspx
代码示例:
You should use the ShowDialog Method: http://msdn.microsoft.com/en-us/library/system.windows.window.showdialog.aspx
Code Sample:
只需使用 ShowDialog() 方法而不是 Show()
Just use ShowDialog() method instead of Show()