Designing Good User Interfaces

advertisement
Designing Good User Interfaces
Some simple guidelines to make your programs much easier to use.












Don’t overuse message boxes. They should be used strictly for cautions or notices to the user—
not as a means of displaying results.
If intermediate results can be calculated on the fly, this is much friendlier to the user than
having to wait to push a button and then having a message box appear with the answer. For
tools that can be educational as well as useful, like matrix and financial calculators (which
together were about 10% of the projects I saw), it can be really nice if the user can tweak
certain entries and see how they affect the output immediately. The computer can handle doing
the calculations many times—put it to work!
Don’t waste space on forms. They shouldn’t look crowded, but there are many situations where
users want your program to take up as little screen space as possible: small monitors, running
multiple programs at once, remote desktop.
Slick graphics are wonderful and can make your programs look professional. Just make sure they
don’t overwhelm the functionality of the program and have users thinking it is just pretty
wallpaper.
Whenever possible, keep user input available for editing, rather than having your “Submit” or
“Calculate” button enter the data and do the calculation and at the same time resetting the
form. Clearing the entered data should generally be a completely separate operation.
Whenever possible, provide reasonable defaults for required fields. Sometimes these can be
calculated from other entries. (For example, if you were writing a planning program for wedding
receptions or funerals, you might estimate the number of cars needed to be the number of
people attending divided by four; as soon as the user enters the number of people, enter that
number divided by four as the default in the Cars field. The user can still override it—but doesn’t
have to.) Defaults won’t just save your user (or grader) time—they’ll save YOU time. When
you’re testing and debugging a program, having to enter data every time you restart quickly
becomes tedious. The time spent assigning default values gets paid back many times over, for
you and the user. Of course, some fields, like Last Name, have no reasonable default. But others,
like Order Quantity, do (probably 1 for Order Quantity).
Don’t make fields required if they’re not.
Use the right controls for the job. Limiting the user to only valid options is much friendlier than
using a message box to complain about an invalid entry.
Use VB’s alignment tools to make your form look organized and attractive.
In all but the simplest forms, set the tab order, assign keyboard shortcuts, and use tooltips.
Set your form’s Text property to something relevant. Not only does this property appear at the
top of the form, it also appears in the Windows taskbar. Make sure it doesn’t just say “Form1”.
Controls I like:

o
Combo boxes: Be careful choosing the style, depending on how much you need to
restrict user input.
o
Numeric UpDowns: I don’t care too much for the UpDown part, but the control restricts
entries to numeric values between the min and max, with a specified number of decimal
points.
o
Trackbars: Especially good for “what-if” calculators and such—watch how my overall
GPA is affected by various grades in this class; watch how my future value is affected by
changes in interest rates, etc.
Controls I don’t like:
o
Masked textboxes: They’re just hard to use. For numbers, the Numeric UpDown is much
more user friendly.
o
CheckedListBox: If you feel like wasting a few hours without getting anywhere, try to
make a CheckedListBox control work.
Failing to observe these guidelines without excellent reason will result in your homework or project be
graded as unsatisfactory. Get it right the first time and save us all some time.
Download