Assessments
Exercise 3
Multiple-Choice Quiz 4
2.1.1 Labels
Label Controls
Label Controls
age
E.g.,
Showing the filename on the title bar of a document
keeps users informed about what files are in each window.
Dimming or shading a menu option:
tells users the status of the option—that the option is not
currently available.
Icons show the presence of applications or documents.
Date/Time Control Panel Applications of this Heuristic
2.2.1 Buttons
2.2.2 HE: Consistency and Standards.
2.2.3 HE: User Control and Freedom.
2.2.4 HE: Flexibility and Efficiency of Use.
Assessments
Exercise 4
Multiple-Choice Quiz 5
2.2.1 Buttons
Enabled
Font
Events
Button Control Description
Changes in the colors of lines make a button
appear to be pressed.
Font
controls the font used to display the caption of
the button.
Events
Input events that correspond to user
manipulation of input devices are delivered to
the controls of a Visual Basic interface
Visual Basic should then respond to these input events.
The controls process the events in order to
provide visual feedback and
invoke the actions specified by the programmer.
Events
These actions are performed in Visual Basic by
event handler subroutines.
Note
the situations that lead to the calling of these subroutines
are also referred to as events.
Event handler subroutines
Event handler subroutines for a particular control are
named in a specific way in VB.
The name of all the event handlers for a given control begin with
the name of the control followed by an underscore character ("_")
and then end with the name of the event they are to respond to.
E.g., Click a button named "myButton" event.
the subroutine named "myButton_Click" would be called when
that button was clicked.
Code responding to the activation of that button would then be
placed in the body of the mybutton_Click subroutine:
Private Sub myButton_Click(ByVal sender as Object, ByVal e
As System.Windows.Forms.MouseEventArgs) Handles
myButton.Click
<put code to respond to button activation here>
End Sub
Operation in VB.net 2005
double click on any control, Visual Basic will
automatically create code for the most common event
handler routine associated with that control (if it does
not already exist) and place you in the code editor at
that routine.
Edit another event handler
move to the code associated with a particular
control by choosing the control name from the
pull-down list of names at the left.
move to a particular area of the code (such as
global declarations or functions and subroutines
not associated with events) by selecting items
from these pull-down lists.
Application routines code
The code that responds to the activation of a
button normally carries out some action.
Typically, this involves modifying information in
the model that pertains to the objects of interest
by calling their
set accessor routines and/or
one or more of the subroutines that make up the
application.
Application routines may modify model objects.
changes model objects by updating the properties of any
controls that are related to them.
additional information of events
The Click event for buttons does not have
additional information associated with it.
Other events, however, may have additional
information.
E.g., the KeyDown event not only has
an integer code that indicates which key was pressed
but also
a second integer code that indicates the states of the
modifier keys (SHIFT, CONTROL, and ALT) at the
time the key was pressed.
This additional information about the event is passed
as parameters to the particular event handling routine.
events associated with button
Private Sub name_Click(ByVal sender as Object, ByVal e As
System.EventArgs)
invoked whenever the control is activated (by a mouse press and
release).
Private Sub name_MouseDown(ByVal sender as Object, ByVal e
As System.Windows.Forms.MouseEventArgs)
Private Sub name_MouseUp(ByVal sender as Object, ByVal e As
System.Windows.Forms.MouseEventArgs)
invoked when a mouse button is pressed or released over a button
respectively. Information about the state of the mouse when a
button is pressed is accessible via the e parameter.
E.G., e.Button can be used to determine if the right, left or middle
button was pressed. Similarly, the location of the mouse when the
button was pressed or relased can be determined using e.X and
e.Y
events associated with button
Private Sub name_MouseMove(ByVal sender as
Object, ByVal e As
System.Windows.Forms.MouseEventArgs)
called whenever the mouse moves over the control
Note
if no event handler routine is declared for a given event,
it is simply ignored.
2.2.2 HE: Consistency and Standards
Don’t Frustrate the User
Maintain Platform Consistency
Maintain Application Consistency
Date/Time Control Panel Applications of this
Heuristic
Example UAR: Aspect 1 — Button Labels Are
Good
Example UAR: Aspect 2 — Button Names Are
Very Similar
Important — When Heuristics Conflict
Brief introduction before
Information that is the same should appear to be
the same
same words
icons
help
Maintain Platform Consistency
Products should conform to the conventions of the
platform
Same style
Windows
Mac
Linux
Products adhere to platform conventions may minimize
frustration
E.g. .
The location of the File menu ——leftmost item
The contents of the File menu ——opening, closing, saving,
printing, and quitting
Users are able to learn, but they don’t have to
they can concentrate on learning the commands that are unique to
the product —— the own function of the software
Maintain Application Consistency
Consistency within an application is also important
location consistency(in menu)
commands should not move around between menus
commands should not appear and disappear from menus.
menu items that aren’t available should be dimmed (or shaded)
instead of being removed from the menu.
keyboard shortcuts
keyboard shortcuts should comply with platform and application
standards.( ctrl + x, ctrl + o, ctrl + c, ctrl + v)
Messages, warnings, and alarms
should be consistent in their wording and in where they appear
Color semantics
used as codes, should keep the same meaning throughout
E.g., red for error , yellow for warn
Maintain Application Consistency
Formatting should be kept consistent
date and time,
monetary units,
numbers
Data presentation should be kept consistent
data presentation such as,
labeling,
capitalization,
font face, use of bold and italic, and the placement of fields)
Dialog boxes should be consistent in their presentations
Terminology
words used to describe actions, behaviors, and commands should
be kept consistent.
Date/Time Control Panel Applications of this Heuristic
HE6 - Problem
Important — When Heuristics Conflict
heuristic gives conflicting design advice
the very nature of heuristic evaluation
it uses heuristics
heuristics are not guaranteed to lead to a solution
What to do?
think hard about whether the conflicting advice makes
any real difference to the user
do an error analysis
error analysis
error analysis suggests that
the cost of confusing the two buttons
because their labels do not reflect the actual differences in their
functions is relatively small.
But other case will be a more severe consequence of
error
it will be more important to resolve the conflict in some
other way
it is better to go with the standard labels because there
really are great benefits to be had from adhering to
platform standards.
Click the image to run the application and analyze
Rearrange UARs
Go back and put this error analysis in the UARs
Record the design decision you have made
If the question comes up again, you'll know why you
made this decision.
What shall we do when in more complicate case?
some case, the error analysis is probably the end
of the controversy
in other instances
more severe consequence of error
more important to resolve the conflict in some other
way.
E.g.,
dialog boxes that are more difficult to get back to if you
hit OK mistakenly instead of Apply (and undo doesn't
usually work to get a dialog box back!).
In these cases, you should use another technique (e.g.,
the think-aloud technique) to get more information about
the issue.
2.2.3 User Control and Freedom
Let the User Be in Control
Provide an Undo Mechanism
Require Confirmation
Provide an Escape Route
Date/Time Control Panel Applications of this Heuristic
Example UAR: Aspect 1 — Cancel Button Is Good
Example UAR: Aspect 2 — UARs Sometimes Lead to
More UARs.
Let the User Be in Control
"who's in charge "
strongly affects how a user feels about an application
Users get frustrated when they don’t feel in control of
the computer
users should initiate actions, not the computer
carefully arrange the wording of messages
their tone should suggest
the computer is ready and compliant
TextAlign
determines whether the radio button appears
to the left of the textual caption
to the right.
Radio Button Events
Click handler routine is the primary handler for
radio buttons and is called when a radio button
is selected.
Radio Button event handlers vs. CheckBoxes
and buttons event handlers
the same event handlers
The primary difference : radio buttons are normally
placed in groups.
2.3.2 HE: Error Prevention
Prevent Errors
Warn Users about Potentially Destructive
Actions and Require Confirmation
Date/Time Control Panel Applications of this
Heuristic
When Interface Aspects Are Repeated
Example UAR: Automatic Adjustment of
Daylight Savings Time Is Good
Prevent Errors
People explore interfaces and learn by trial and error
As much as possible, disallow illegal actions
E.g., both MacOS and Windows dim (or gray) and disable illegal
actions.
Dimming an action is preferable to removing the action
from a menu or dialog box, because when an action is
dimmed, its position on the interface menu doesn’t
change, only its availability. E.g.,
in a file dialog box, only files that an application is capable of
opening are listed.
The other files in the folder that the application cannot open are
not shown, reducing the chance that the user will attempt to open
them
Warn Users about Potentially Destructive Actions and
Require Confirmation
Warning messages should be written in the
user’s language
provide the user with the option of canceling the
command.
Avoid double negatives in messages, especially in
warnings.
E.g, the message "If you don’t want this to not be saved,
click YES" requires careful reading to determine what
the consequences of clicking YES would.
Warn Users about Potentially Destructive Actions and
Require Confirmation
Make sure warnings clearly state the
consequences of continuing with the action.
Destructive actions should require explicit
confirmation.
Date/Time Control Panel Applications of this
Heuristic
Example UAR: Automatic Adjustment of
Daylight Savings Time Is Good
HE10
When Interface Aspects Are Repeated
E.g., the buttons at the bottom follow the
Windows Design Guide (UAR# HE5),
the OK and Apply labels may be confusing to users
(UAR# HE6).
The Cancel button provides an emergency exit (UAR#
HE7) but it may not provide enough feedback about
when it will actually cancel changes (UAR# HE8)..
when following a standard, it is not necessary to
write up separate UARs for each occurrence of
the standard.
When Interface Aspects Are Repeated
In a real-world project, you could do just as we
did here.
Start with a single screen and write separate UARs for
each aspect of that screen.
When you go to the next screen and discover that the
same standards are followed, you can write a set of
UARs for the application concerning the standard in
general (that is, generalized versions of UARs # HE5-9).
then write one UAR for the consistency of the system's
own interface
Take Assessment
Practical Quiz 1
2.4 Creating with ListBoxes and ComboBoxes —
Evaluating with One Heuristic.
Assessments
Exercise 5
Multiple-Choice Quiz 6
2.4.1 ListBoxes and ComboBoxes
ListBox Control Description
ListBox Properties
MultiColumn
IntegralHeight
Sorted
TopIndex
SelectionMode
Items
SelectedIndex
ListBox Events
ComboBox Control Description
ComboBox Properties
DropDownStyle
Text
SelectionStart, SelectionLength, SelectedText
ComboBox Events
ListBox Control Description
ListBox can be used for selecting from a set of
alternatives.
display a list of items
allow the user to select one or more of them.
In vb net
Aother control
ListBox Control Description
ListBoxes can hold the focus.
The TAB key moves the focus to and from a ListBox.
While the focus resides in the ListBox, the arrow keys can be used
to move the focus between particular items and the SPACEBAR
(but not the ENTER key) can be used to select or unselect items.
In addition to the normal focus mechanism, ListBoxes
also allow efficient selection of items using the
keyboard.
If a letter key is pressed, the selection of the ListBox will move to
the next entry in the list that starts with that character.
allows rapid access to long lists without deliberate scrolling.
ListBox Properties
MultiColumn
determines whether scrolling across items
False - using a vertical ScrollBar and a single column of items
True - using a horizontal ScrollBar and a series of columns.
IntegralHeight ( 列表 项目是 否允 许部分 显示 )
determines whether an integral number of items or columns is
always displayed.
False - partial items or columns may be displayed
True - only complete items or columns are shown
Sorted
This property determines whether the items in the list are
automatically sorted alphabetically .
ListBox Properties
TopIndex
determines which item is currently shown as the first visible one in the list.
Changing this item causes the list to scroll so that the given index item is the
first shown.
Note: this property is not available at design time, only at edit time.
it does not appear in the property list editor
only be set programmatically with code.
SelectionMode
determines whether the ListBox supports only one selected item or multiple
selected items.
"One," - only one selection at a time is allowed.
"MultiSimple”- multiple selections are allowed, and items are toggled "On" and
"Off" by simple clicks (or by using the focus mechanism).
"MultiExtended," then multiple selections are allowed.
simple clicks reset the selection to one item.
Clicks with the SHIFT key held down perform a contiguous range of selections that
extend from the previous selection to the point of the click.
Clicks with the CTRL key held down toggle an individual item "On" or "Off."
ListBox Properties
Items
contains an array of text strings making up the list items.
The number of items currently in this list is maintained via
Items.Count (not available at design time).
其实它是一个 Icollection 对象(可使用 add,insert, remove,
clear 方法)
可以加入任意对象,显示 displayMember 指定的属性值
SelectedIndex
hold the index of selected item.
If multiple items are selected, SelectedtIndex will contain the
index of the item currently within the highlight rectangle (used
for indicating focus) —whether that item is selected or not.
ListBox Properties
SelectedIndices 集合
SelectedItems 集合
ListBox Events
Private Sub
name_SelectedIndexChanged(ByVal sender
As System.Object, ByVal e As
System.EventArgs)
As with most controls this event handler is the
most commonly used one and is invoked when
the user completes a selection (or range
selection).
The SelectedIndex propertie can be used to
determine which selections have been completed.
CheckedListBox 控件
ListBox 控件的 变体( VB6 中两者 是同一个
)
继承自 ListBox
不支持多个选中 ( 与多个 checked 区别 )
SelectionMode 属性只能选取 one 或 none
CheckedItems 集合(对比 ListBox )
CheckedIndices 集合(对比 ListBox )
ComboBox Control Description
The ComboBox control is related in functionality to the
ListBox.
It allows the user to select an item from a list of potential items.
In its default form, the ComboBox also allows the user
to alternately type in a completely new entry in a text
entry field.
The term "combo box" in fact comes from the notion of
combining a text entry field with the functionality of a
single selection ListBox.
ComboBoxes are also more compact—they normally
take up only a little more than one item's height on the
screen.
The full set of items is normally accessed by pulling
down the list portion of the ComboBox.
ComboBox Control Description
ComboBoxes come in three styles (as determined
by the DropDownStyle property):
ComboBox Control Description
In dropdown and dropdown list forms, a
ComboBox displays a small downward arrow
button.
If this button is pressed, the item list drops down and
becomes visible.
Items may then be selected from the list by clicking
them, at which point the text for the item is placed in the
ComboBox text area and the dropdown list is
disappears.
In the dropdown and simple forms, the user may
also type arbitrary text into the text entry area.
ComboBox Properties
DropDownStyle
determines which of the three possible styles a
ComboBox uses. Valid values are:
Dropdown
Simple, and
DropdownList
Text
contains the current text appearing in the textbox portion
of the ComboBox.
ComboBox Properties
SelectionStart, SelectionLength, SelectedText
runtime-only properties and do not appear in the property sheet.
contain information about the current textual selection in the
textbox portion of the ComboBox (or allow the selection to be
set).
SelelectionStart
The start of the selection.
SelelectionLength
indicates the length of the current selection (SelLength will be 0 when the
selection is an insertion point rather than a selected range of text).
SelectedText
contains the actual text string corresponding to the selection (and allows the
selection to be replaced by a new text string).
ComboBox Events
Private Sub name_TextChanged(ByVal sender
As System.Object, ByVal e As
System.EventArgs)
occurs whenever the text associated with the ComboBox
changes.
This event handler, rather than the Click handler, is often
the primary one used for handling modifications to a
ComboBox.
2.4.2 HE: Aesthetics and Minimalist Design
Minimalist Design
Date/Time Control Panel Applications of this Heuristic
Example UAR — TimeZone ListBox Is Not Good
Sometimes an Interface Aspect Will Violate Many
Heuristics
Minimalist Design
novice computer users, are easily overwhelmed
by a screen that is full of tabs, buttons, dialogs,
and menu items.
A minimalist design
directs the user’s attention to the current task
minimizes the presence of irrelevant information.
In a process having several steps, a minimalist
design presents only information important to
the current step:
Make strategic use of white space to focus the
user's attention on critical areas.
Minimalist Design
Limit the numbers of widgets (boxes, buttons,
menus, tabs, etc.) that the user must focus on at
one time.
Reduce the number of choices the user must
handle at one time.
Group related tasks together.
Example
E.g.,
the Windows Display Control
Panel features several areas
(Background, Screen Saver,
Appearance, Plus!, and Settings),
each of which contains parameters
that users can adjust. If, however,
the panel featured only one large
window that contained all the
parameters, many users would
likely be overwhelmed.
Wrap
UpDown Events
Scrollbar Control Description
Scrollbar Properties
Value
Minmum, Maximum
SmallChange, LargeChange
Scrollbar Events
Controls Extend the VB capability
strengths of Visual Basic
it can be extended with new controls and other components
a large library of controls is available that work with the Visual
Basic system
work in Visual Basic like any other control
Controls
mostly interactive
more computational
providing an interactive and/or programmatic interface to
some software package,
hardware capability, or
network service
A suitable way for iterative development, via a Visual
Basic control
Making a software package or other capability accessible in an
interactive environment
UpDown Control Description(vb6)
In visual basic 6
not one of the default controls
It must be loaded from a library
How to get it ?
choose "Components..." from the "Project" menu
press the corresponding checkbox and pressing OK
Font
controls the typeface, size, and style (i.e., bold, italic,
etc.) that text within the textbox appears in.
Properties
BorderStyle
determines whether a border is drawn around the
textbox.
"0-None“
"1-Fixed Single".
PasswordChar
If set, characters typed will be shown as the character
value rather than actually typed.
used for fields that contain passwords or other sensitive
data that should not be divulged.
MultiLine
determines whether the control will accept multiple
lines of text
"True“ for multiline
"False“ for one line
Properties
MaxLength
indicates a maximum number of characters that may be
entered into the control.
"0" indicates that no limit is to be imposed.
Scrollbars
indicates whether include scrollbars
"0-None",
"1-Horizontal",
"2-Vertical",
"3-Both".
Properties
ReadOnly
When True, locks the text cannot be altered by the user.
SelectionStart, SelectionLength, SelectedText
runtime-only properties
contain information about the current textual selection
SelectionStart indicated The start of the selection.
SelectionLength indicates the length of the current
selection (SelectionLength will be zero when the
selection is an insertion point rather than a selected range
of text).
SelectedText contains the actual text string
corresponding to the selection (and allows the selection
to be replaced by a new text string).
Events
MouseMove
MouseUp
2.6.2 Tabbed Dialog Controls
Events
Tabbed Dialog Control Description(vb6)
Where to get ?
is not one of the default controls that appear in the toolbox palette
To load
choose "Project“ >>> "Components..."
Load the "Microsoft Tabbed Dialog Control 6.0" control
often used when more options or other interface
elements are needed than will comfortably fit in a single
Frame.
The Tabbed Dialog control provides a series of different
views that appear to be stacked on top of one another.
Each of these views is actually a separate container that
can contain a series of controls.
Tabbed Dialog Control Description(vb6)
A series of tabs with captions (designed to look
like file folder tabs) are provided,
one for each of the containers.
Clicking on a particular labeled tab brings the container
associated with that tab to the front. These containers
are sometimes referred to as tabs, and sometimes they
are called panes.
Tabbed Dialog Control Description
is a container that is often used when more options or
other interface elements are needed than will
comfortably fit in a single Frame.
provides a series of different views that appear to be
stacked on top of one another.
Each of these views is actually a separate container that
can contain a series of controls.
A series of tabs with captions (designed to look like file
folder tabs) are provided, one for each of the
containers.
Clicking on a particular labeled tab brings the container
associated with that tab to the front.
These containers are referred to as TabPages.
Tabbed Dialog Control Description
At design time, a Tabbed Dialog control can be
manipulated by pressing on a particular labeled
tab, which brings forward the container
associated with that tab—which can then be
edited like any other container by placing
controls inside it, moving the controls inside it,
or deleting controls inside it.
Demo
Properties (vb6)
Tab
This property controls which tab is active (appears to be
on top of the stack of containers). When a particular tab
is active, the Caption property refers to the caption for
that particular tab. Note that tabs are numbered from
zero to N-1, where N is the number of tabs.
Tabs
The Tabs property determines how many different tabs
the Tabbed Dialog control has.
TabsPerRow
The TabsPerRow determine how many tabs can appear
in one row of tabs without creating another row.
Properties (vb6)
TabHeight, TabMaxWidth, WordWrap
These properties control the size of the labeled tab. TabHeight determines the
height of each tab. Tab change width to accommodate their labels.
The TabMaxWidth property determines how wide a tab gets before it starts
clipping its label, or wrapping the label text to another line.
The WordWrap property determines whether clipping or wrapping of the long
labels occurs.
TabOrientation
This property can be set to place the tabs of the dialog box along different
edges.
"0-ssTabOrientationTop" places the tabs at the top
"1-ssTabOrientationBottom" places them at the bottom of the dialog box
"2-ssTabOrientationLeft" place the tabs along the left edges
"3-ssTabOrientationRight"' place the tabs along the right edges
Note that not all fonts support rotation, so use of the left and right orientation
may be limited in practice by the font chosen for labels
Properties
TabIndex
controls which tab is active (appears to be on top of the
stack of containers).
When a particular tab is active, the Caption property
refers to the caption for that particular tab.
tabs are numbered from zero to N-1, where N is the
number of tabs.
TabPages, MultiLine
determines how many different tabs the Tabbed Dialog
control has. The MultiLine determine whether tabs can
appear in more than one row.
Events
The Tabbed Dialog control normally handles the
inputs necessary to switch between its containers
internally.
event handlers are not normally used with
Tabbed Dialog controls themselves.
It is possible to handle various standard events
"manually" in order to implement special
effects.
例如,在切换 tab 时做输入的合法性检查等
2.6.3 HE: Recognition Rather than Recall
Show All Objects and Actions that are Available
Reduce Demands on Memory
Date/Time Control Panel Applications of this Heuristic
Example UAR — Presentation of Time Zone Setting is
Good.
Show All Objects and Actions that are Available
People are better at recognition than they are at
unaided recall.
E.g., there are people who can't remember landmarks
well enough to write down directions for driving from
their house to a place across town, but can themselves
drive to that place easily.
That is because, at each stage of the journey, they
recognize landmarks that help them remember the next
stage of the journey (e.g., turn left at the post office,
turn right at the park, go straight until the bridge, etc.).
E.g., Learn English words , hard to recall / easily read
Assessments
Exercise 6
Multiple-Choice Quiz 7
2.7.1 HE: Help and Documentation
Help vs. Documentation
Always Available
Easily Searchable
Relevant to the Task
Date/Time Control Panel Applications of this
Heuristic
Example UAR: Aspect 1 — Some Help
Messages Are Imprecise
Example UAR: Aspect 2 — Help Availability
We have introduced ……
If the system is not an extremely simple, walk-
up-and-use application
help and documentation should be always
Available
easily searchable
Why it is good?
The pop-up window helps the user recognize that
something needs attention.
The window's first statement ("The disk in destination
drive is full") diagnoses the problem.
The window's second statement ("Insert a new disk to
continue") gives instructions for recovering from the
error.
On a Macintosh
the system first checks to see if there is enough
room on the floppy disk for the materials being
copied,
if there is not, it doesn't start the copying
process.
This heuristic doesn’t apply to this prototype
Why?
The Date/Time control panel prevents errors so
effectively that there is never a need for it to display
error messages
No chance to make a mistake and misunderstand
Take Assessments
Exercise 6
Multiple-Choice Quiz 7
2.8 Menu Controls and Some Example UARs
2.8.1 Menu Controls
2.8.2 Example UARs
Assessments
Practical Quiz 2
2.8.1 Menu Controls
Shortcut
Events
Menu Control Description
The Menu control
Provides a set of pull-down menus that can be attached
to a form.
consist of a set of top-level textual captions displayed
horizontally at the top of a window.
Pressing on a caption causes a menu to drop down that
consists of a series of menu items that have textual
labels.
Hierarchical menus that support submenus "under" a
menu item are also supported.
Shortcut and Separator lines
shortcut
placing an "&" before the desired shortcut character in the item's
caption.
menu items can have shortcut keys accessible to the user using the
SHIFT, CONTROL, function keys, and other keys.
shortcut keys are specified in the Shortcut property.
Separator lines
allow the menu items to be segregated into logical groupings.
help provide a structure that allows users to
organize the concepts of a menu
make learning menu items easier.
How to place A separator line?
creating an item whose caption is a single minus sign ("-").
Properties
Checked
determines whether a check mark appears next to the
menu item.
Enabled
When False, the Menu is disabled and is drawn in a gray
color
Shortcut
indicates the shortcut character for the menu item.
Include
a letter key modified by SHIFT and/or CONTROL,
a function key
a function key modified by SHIFT and/or CONTROL
a few other keys.
Events
Private Sub name_Click(ByVal sender As
Object, ByVal e As System.EventArgs)
The only event generated by Menus is the Click event,
which is invoked when the menu item is clicked.
2.8.2 Example UARs