Using forms creatively
Good design begins when you consider how your application uses the infor-
mation that appears on the form and how you want to interact with it. A form
that presents every piece of information that you might ever need sounds
good until you try to use it. A form should contain focused information that
easily fits on any display that you use. You might find that you need to design
a series of forms that appear in sequence.
Another consideration is clutter. Even if you create a focused form, it might
contain too much nonessential information. That’s why you see Details and
Properties buttons of various kinds on forms. When you need to see the
details, you can click the button to present another form or expand the exist-
ing form. Otherwise, you can ignore the details and provide just the essentials.
Add informational forms to your program as needed. When a program com-
pletes a task, the program should tell you about it. A message box that says
“I’m done” might seem appropriate, but often it’s a nuisance. The exception
to this rule is when the user is actually waiting for confirmation that the
application has completed a task, in which case you should display the
message box. Otherwise, you can include program statistics or other helpful
information as part of an informational field or a status bar. I often build sta-
tistical forms into my programs so that I can monitor performance. When I
see that the program isn’t performing as expected, I know that I need to look
for potential problems. I often fix the problem long before it becomes a work-
stopping issue.
The important issue to consider is that a form is an interaction between a
person and the program running on the computer. If the form that you design
doesn’t evoke a response, perhaps you haven’t used the form creatively enough.
You should be able to look at a form and have a good idea of its purpose. Each
control (such as a pushbutton) should provide a
ToolTip
(the little window
that pops up when you hover the mouse over the control) that helps anyone
using the form to understand the intent of that control. Finally, context-
sensitive help and other forms of visual aid should make difficult forms easy
to understand.
Designing a form for your application
When you use the Forms Designer, you can easily get the idea that the VBA
Integrated Development Environment (IDE) is somehow performing magic on
your behalf by creating forms visually. A form is simply a specialized kind of
code, and you use code to perform a number of tasks in this book. Forms are
simply an extension of what you do when you perform any other task. The
only difference is that a form is visual: It presents information onscreen in a
form that the user can see.
156
Do'stlaringiz bilan baham: