Winforms:在对话框外单击时关闭模式对话框

编程入门 行业动态 更新时间:2024-10-25 20:18:38
本文介绍了Winforms:在对话框外单击时关闭模式对话框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有一个打开的模态对话框(Windows 窗体).我想要,在对话框外部(在父窗体上)单击时关闭对话框.我该怎么做?

I have an open modal dialog (Windows Forms). I want, that the dialog is closed when clicking outside the dialog (on the parent form). How can I do that?

推荐答案

你应该把它改成非模态对话框(用 Show(..) 打开它)然后使用 停用事件并关闭它.

You should change it to a non-modal dialog (open it with Show(..)) and then use the Deactivate event and close it.

更多推荐

Winforms:在对话框外单击时关闭模式对话框

本文发布于:2023-08-06 13:15:03,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1312634.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:对话框   单击   模式   Winforms

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!