Вы находитесь на странице: 1из 5

ESC key (escape) .

I use the Exit button if I have one on the form and at design time in the
Properties Window I set the Cancel option to True . To do this, select the Command button which
is to be the cancel button. Scroll in the Properties Window to the Cancel property . Click on the
drop down arrow and click on True . Touch ENTER key . (Just like the Default property there are
only two settings for the Cancel property, True or False . ) . Again, do nothing and the setting will
automatically be False.

Now, a quick recap: There are three ways for a user to access the cmdExit (command button):

 Clickonthebutton
 Use the keyboard short-cut, ALT + X, if the programmer has
usedE&xitintheCaptionsothatXwillbea"hotkey"touse
withALTkey.
 Use the ESC key (Escape), if the Cancel Property of cmdExit
hasbeensettoTruebytheprogrammer(atDesigntime).

Note: An additional way to exit or cancel the form from Run mode is the obvious Windows
method of clicking on the exit button in the Title bar of the form .

ToolTipsPropertyforanycontrolobject,includingtheCommandbut
ton
The Cancel Property and the Default Property were inherent only to the Command button. Many
properties available to the command button may also be set with other control objects from the
toolbar, and even objects not from the toolbar . The T oolTips property is available for setting
with any of the Visual Basic control objects .

The ToolTips property is a clever way to have the user read a message about a control object
simply by hovering with the mouse pointer over that object for a couple of seconds .

© Einstein College of Engineering


CS1015 User Interface Design

Setting the message of this property is very simple . Just click on the Command button or another
object to select it and then in the Properties Window (F4), scroll down to ToolTips and double
click in the space to the right of ToolTips and start t yping your message without quotation marks
. You will need to run the program (F5 shortcut) , and hold your mouse pointer over the object in
order for your ToolTip message to appear . Always check your ToolTips in the Run mode just to
make certain they are functioning the way you want them to. Remember, set this Property,
preferably at Design time.

Text-Entry Field (Control) — Reference

Description

A text-entry field is a text field where a user can type or place characters, as arguments, in an
application.

Text-Entry Field

When to Use
Recommended
Provide a text-entry field to allow the user to enter characters.

Guidelines
Required
Support insert mode for all entry of text.

Required
Do not support replace mode when nontextual elements (for example, icons or choices)
are included as elements in text and laid out as characters.

Recommended
Provide replace mode for text entry if the text is displayed using a fixed-width font.

© Einstein College of Engineering


CS1015 User Interface Design

Recommended
If you provide replace mode, allow the user to switch between insert and replace mode
by pressing the Insert key.

Initial Values in Text-Entry


Fields Recommended
If a text-entry field must contain a value, provide an appropriate initial value.

Recommended
If the user will typically replace the initial value in the text-entry field, use a persistent
selection to select the entire initial value so that the data can be replaced by typing the
first input character.

Verification of Entered Text


Required
Even if the information entered by the user into a text-entry field is not acceptable to the
application and if the focus has been moved out of the text-entry field, do not
automatically move focus back to the text-entry field.

Recommended
When using an explicit focus policy, if the information entered by the user into a text-
entry field is not acceptable and focus is on another control, display a warning message
that includes a choice that returns focus to the text-entry field.

Optional
If the information entered by the user into a text-entry field is not acceptable and focus
has been moved out of the text-entry field, mark the field in some way (for example, with
a new color) so that the user can locate and correct it.

Insert Mode
Required
In insert mode, position the text cursor between adjacent elements.

Required
In insert mode, when the user types a character, insert the character before the cursor.

Replace Mode
Required
In replace mode, display the text cursor as if it were on a character. However, with respect
to the rules for navigation and selection, treat it as if it were positioned prior to the
character on which it is displayed. When the cursor is at the end of a line, it should appear
to be on an empty character following the last character on the line.

Required
In replace mode, when the cursor is not at the end of a line and the user types a printing
character, delete the character on which the cursor appears before inserting the new
character. This should have the effect of replacing the character.

Required
© Einstein College of Engineering
CS1015 User Interface Design

In replace mode, when the cursor is at the end of the line and the user types a printing
character, insert the character before the cursor position.
Behavior
Required
When a control supports text entry, support primary, clipboard, and drag-and-drop
transfer in the text field.

Required
Allow the user to scroll data in a text-entry field when more text can be typed or when
more information is available than can be displayed in the field.

Required
In text, when the user presses Space or Shift Space, insert a space.

Required
In a text-display field or a single-line text-entry field, when the user presses Enter, invoke
the default action.

Required
In a multiline text-entry field, when the user presses Enter, insert a new line. End the
current line with the character preceding the current cursor position and start a new line
with the following character.

Required
In a text-display field, use Tab and Shift Tab for tab-group navigation.

Required
In a multiline text-entry field, use Tab and Shift Tab for internal navigation. Use Tab either
to insert a tab or to skip to the next tab stop. Shift Tab should have either no effect or
should skip back to the previous tab stop.

Required
In a single-line text-entry field, use Tab and Shift Tab either for tab-group navigation or
for internal navigation as in a multiline text-entry field.

Recommended
In a text-entry field, when the user presses Ctrl Delete, delete the characters following
the cursor to the end of the line. If text is selected, delete the selection instead.

Guidelines
 Label the entry field with a text label above it or to its left, using sentence capitalization.
Provide an access key in the label that allows the user to give focus directly to the entry
 field. 
 Right-justify the contents of entry fields that are used only for numeric entry, unless the
convention in the user's locale demands otherwise. This is useful in windows where the
user might want to compare two numerical values in the same column of controls. In this
case, ensure the right edges of the relevant controls are also aligned. 


© Einstein College of Engineering
CS1015 User Interface Design

 When the user gives focus to an entry field using the keyboard, place the text cursor at the end of
the existing text and highlight its contents (but don't overwrite the existing PRIMARY clipboard
selection). This makes it easy to immediately overtype or append new text, the two most common
 operations performed on entry fields. 
 Size text entry fields according to the likely size of the input. This gives a useful visual cue to the
amount of input expected, and breaks up the dialog making it easier to scan. Don't make all the
 fields in the dialog the same width just to make everything line up nicely. 
 In an instant-apply property or preference window, validate the contents of the entry field when it
loses focus or when the window is closed, not after each keypress. Exception: if the field accepts
only a fixed number of characters, such as a hexadecimal color code, validate and apply the change
 as soon as that number of characters have been entered. 
 Provide a static text prompt for text boxes that require input in a particular format or in a particular
 unit of measurement. For example: 
Figure 6-4 Text entry field with static text prompt 





 Where possible, provide an additional or alternative control that limits the required input to the
valid range. For example, provide aspinbox or slider if the required input is one of a fixed range of
 integers, or provide access to a GtkCalendar control if the user has to enter a valid date: 
Figure 6-5 Text entry field requiring a date as input, with a button beside it to pop up a GtkCalendar
control to simplify the task 

Вам также может понравиться