开发者

Any good alternatives for MessageBox in WinForms?

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 "开发者_如何学JAVAthere 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


We implemented a mechanism similar to taskbar notification, but placed in some coordinates inside a WinForms control.

This has some advantages:

  • You have some context about where (location) the notification is shown and why.
  • It is non modal, so it not blocks the GUI.
  • It's easy to implement using a owned form without border.
  • You can place it wherever you want.
  • You can show a link label with a short explanation and show help, other dialos, or link some actions if the user needs further explanation. The user experience is improved.

But I recommend using notifications only for informative messages.

You must take into account some tips about the messagebox:

  • It's the standard way to show information to the user.
  • It should be user to notify an error message or a warning. The messagebox ensures that the user, at least, clicked ok. So the user is aware that something happens. Yes, maybe he didn't read the message, but at lease he saw an error or warning.
  • It is possible that the user ignores other reporting mechanisms.

Hope it helps.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜