Error Messages

Presenting the user with many error messages is often a sign of a shortcoming in your program. Your goal should be to provide enough functionality to make most error messages unnecessary by preventing the user from making errors in the first place. It is always better to prevent an error than to report it. The most common ways of preventing errors are

  • Disabling invalid menu commands and controls The user should never be able to select a menu command or control that will only result in an error message.
  • Preventing invalid user input Use constrained controls whenever possible. In other words, avoid using edit boxes for anything other than unconstrained text and numeric input. For constrained input, use other controls such as combo boxes, lists, sliders, and spin boxes. Use the date and time picker control for dates and times. Edit boxes should be your last choice control, but, if necessary, confirm the user's input immediately instead of waiting until the user clicks the OK button. Ideally, invalid input could be automatically corrected or indicated with some visual feedback.

TIP
Prevent invalid input to eliminate error messages.

  • Providing appropriate defaults Appropriate defaults reduce the need for input, thus reducing the possibility of error. Furthermore, default values make the format of valid input visible. For example, a date field that has today's date as a default value is less likely to result in an error since it makes it clear what date format is expected.
  • Using direct manipulation Direct manipulation eliminates the need for error messages by restraining the manipulation to acceptable limits.

What if you can't prevent the error? Another possibility is to fix the problem automatically. This is a good approach if

  • You can be fairly sure what the user really wants to do.
  • You can make the automatic change obvious.
  • You can give the user the ability to override the automatic change.

For example with Microsoft Word, if I type hte, Word automatically replaces it with the. It is fairly safe to assume that the user doesn't want to create a document with typos in it, so you can be sure this is what the user wants to happen. It is obvious when the automatic change occurs because the user can see the text change. If correctly implemented, there should be a fixed time lapse between the typo and the change so that the change is obvious even on the fastest computer. Lastly, the user can easily override the change. If the user then replaces the with hte, Word leaves it alone. Alternatively, the user can override the change with the Undo command. If the user never wants to do this change at all, he can remove this word from the AutoCorrect list.

TIP
If you fix problems automatically, make it obvious.

If you don't satisfy these three requirements, you run the risk of automatically "fixing" problems incorrectly and with potentially disastrous consequences.

TIP
Use automatic features to help the user, but leave the user in control.



Developing User Interfaces for Microsoft Windows
Developing User Interfaces for Microsoft Windows
ISBN: 0735605866
EAN: 2147483647
Year: 2005
Pages: 334
Authors: Everett N McKay
BUY ON AMAZON

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net