WinForms 中的 MessageBox 有什么好的替代方案吗?
WinForms 程序不可避免地会向用户发送通知。有两种类型的通知:
- 重要:用户需要对其采取行动
- 不重要:有点像“有事情发生,您可能需要注意”。
MessageBox 用于这两种类型是很常见的。但最近我发现 MessageBox 有点烦人:它窃取了用户的注意力,用户必须单击才能关闭它。我想知道 MessageBox 的替代品是什么及其优缺点?
首先,这里有一些想法:
状态栏:不容易显示冗长的通知
任务栏通知:人们是否认为这是邪恶的,因为大多数互联网广告弹出窗口都使用这种方法?
浮动状态栏:Chrome/IE9/Evernote使用类似的浮动状态栏,当没有链接地址或没有消息时隐藏。
- Chrome UI:信息栏和状态气泡
- IE9:通知栏
A WinForms program will inevitably send notification to user. There are two types of notifications:
- Important: user needs to take action on it
- Non-Important: kind of like "there is something going on, and you might want to pay attention".
It's pretty common that MessageBox is used for both of the two types. But recently I found MessageBox is kind of annoying: it steals user's focus and user has to click to dismiss it. I want to know what's the alternatives for MessageBox and their pros/cons?
To start, here is some idea:
Statusbar: not easy to display lengthy notification
taskbar notification: does people think it's evil since most internet ads popup use that approach?
floating statusbar: Chrome/IE9/Evernote use similar floating statusbar, which is hidden when there is no link address or no message.
- Chrome UI: Infobar and Status Bubble
- IE9: Notification bar
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我们实现了类似于任务栏通知的机制,但放置在 WinForms 控件内的某些坐标中。
这有一些优点:
但我建议仅对信息性消息使用通知。
您必须考虑有关消息框的一些提示:
希望有帮助。
We implemented a mechanism similar to taskbar notification, but placed in some coordinates inside a WinForms control.
This has some advantages:
But I recommend using notifications only for informative messages.
You must take into account some tips about the messagebox:
Hope it helps.
我一直在使用表单上的 WebBrowser 控件开发 C# WinForms 解决方案。
此时有三种模式: 提示;倒计时提示;倒计时器和组合(框)提示。
使用网络浏览器控件允许使用 HTML,这使您可以自由选择字体;颜色和尺寸。
如果我只知道如何共享解决方案而不是代码片段,我就会分享我所拥有的内容。
我所得到的东西有效并且有两个部分,设计器和提示本身。
如果管理员联系我,我可以提供下载链接,他们可以查看他们的想法。
I have been working on a C# WinForms solution using the WebBrowser control on a form.
At this time it has three modes: Prompt; Countdown Prompt; Countdown Timer and Combo(box) prompt.
Using the webbrowser control allows HTML to be used which gives you free selection of Fonts; Colors and sizes.
I'd share what I have if I only knew how to share a solution instead of a code snippet.
What I've got works and has two parts, the designer and the prompt itself.
If an admin will contact me I can provide a download link and they can review to see what they think.