另一种方式来通知一个错误的用户错误、方式、通知、用户

2023-09-06 23:59:13 作者:烟霸

我有一个硬件通过协议进行通信的WinForm的软件。

I have a winform software that communicates with hardware through a protocol.

有时候在通信错误发生了,我想通知用户。错误可能是,例如:超时,CRC错误,物理连接断开等...

Sometimes error in communication happens and i would like to notify the user. Errors could be for example: timeouts, crc errors, physical disconnection etc...

我有一个沟通的窗口中,我表现出这些错误,但默认情况下,这是隐藏的。用户可以尽管菜单栏打开它。

I have a communication window in which i show these errors, but by default this is hidden. The user can open it though the menubar.

弹出窗口是恼人的用户(和我自己),所以我想一个非侵入性的方式来通知已经发生的错误的用户。也许一个信息泡沫状时,XP会告诉你更新是准备好你的电脑?我知道的NotifyIcon可以帮助把东西在系统托盘中,我不希望有。我宁愿我的MDI内保持。

Popups are annoying to the user (and to myself) so i would like a un-invasive way to notify the user that an error has occurred. Perhaps a info bubble like when XP tells you updates are ready for your computer? I know that NotifyIcon can help put things in the system tray, which i do not wish to have. I'd rather keep it within my MDI.

我是开放给其他的创意也是如此。

I'm open to other creative ideas as well.

推荐答案

有几个选择,可以在发生错误时可以使用,每个都有自己的优点和缺点:

There are several alternatives that can be employed when an error occurs, each with their own advantages and disadvantages:

的MessageBox弹出窗口 显示一个消息框弹出给用户。 优势:,因为它是模式,用户必须承认错误,继续。 缺点:,因为它是模式,它中断从不管他们在做用户。多个错误也很不方便,需要多次确认。

MessageBox popups Display a message box popup to the user. Advantage: since it is modal, the user has to acknowledge the error to continue. Disadvantage: since it is modal, it interrupts the user from whatever they were doing. Multiple errors are also inconvenient, requiring multiple confirmations.

显示通讯窗口 如果您现有的通信窗口隐藏,显示它使记录的错误可见。 优势:使用现有熟悉的沟通机制。 缺点:如果用户不真正关心的错误,它可能是恼人的沟通窗口不断重复出现

Show the communication window If your existing communication window is hidden, display it to make the logged error visible. Advantage: uses the existing familiar communication mechanism. Disadvantage: if the user does not really care about the errors, it could be annoying that the communication window continually reappears.

状态栏消息 显示在应用程序的状态栏消息。 优势:将始终显示在屏幕上,但闪开主窗口的。 缺点:很难显示多条消息,并可以由用户错过

Status bar messages Show messages in the status bar of the application. Advantage: will always be visible on screen, but is "out of the way" of the main window. Disadvantage: hard to display multiple messages and may be missed by the user.

气球通知 显示附近的通知图标的Outlook / MSN Messenger的风格通知消息。 的优势:为用户,以通知足够明显的,但不一定需要通知图标。还可以整理多条消息到一个单一的弹出窗口。 缺点:可能是恼人的用户

Balloon notifications Show an Outlook/MSN Messenger style notification message near to the notification icons. Advantage: is obvious enough for a user to notice, but does not necessarily require a notification icon. Could also collate multiple messages into a single popup. Disadvantage: could be annoying to the user.

通知图标 显示一个通知图标(或许还有一个气球通知)。 优势:是有目共睹的用户,但仍然不显眼。 缺点:尚未扰乱用户的桌面另一个通知图标

Notification icons Show a notification icon (perhaps with a balloon notification). Advantage: is obvious to the user, but still unobtrusive. Disadvantage: is yet another notification icon to clutter up the user's desktop.

就个人而言,我会选择选项2,因为它需要最少的努力来实现。如果这是不可接受的,一旦人们开始遇到它,查看其他选择。

Personally, I would choose option 2 as it requires the least amount of effort to achieve. If it is unacceptable once people start to encounter it, review the other alternatives.

有关气球通知的例子,不需要通知图标,看到的这个为Windows Forms和这个为WPF。

For examples of balloon notifications that do not require a notification icon, see this for Windows Forms and this for WPF.