创建无模式消息框 [英] Create a Modeless Messagebox

查看:210
本文介绍了创建无模式消息框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

一个人怎么可能去创造一个无模式的MessageBox?我一定要刚刚创建自己的Windows窗体类,并使用了吗?如果是这样,有没有添加一个警告图标(而不是插入我自己一个人的形象),并调整基于文本量的一种简单的方法?

How might one go about creating a Modeless MessageBox? Do I have to just create my own Windows Form class and use that? If so, is there an easy way of adding a warning icon (rather than inserting my own image of one) and resizing based on text volume?

推荐答案

您必须创建一个表单,并使用显示()来显示它无模式。 的MessageBox.show(...)模态表现为在例如通过ghiboz可见;显示的消息的说明,直到用户presses一个按钮。

You'll have to create a Form and use Show() to display it Modeless. MessageBox.Show(...) behaved Modal as seen in the example by ghiboz; "Description of the message" is displayed until the user presses a button.

使用的MessageBox.show(...)您只要在MessageBox是封闭得到的结果;一个无模式消息框,您的code必须有一个机制,如事件,当用户最终选择的东西在你的消息框作出反应。

With MessageBox.Show(...) you get the result as soon as the messagebox is closed; with a modeless message box, your code will have to have a mechanism such as an event to react when the user eventually selects something on your message box.

这篇关于创建无模式消息框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆