Testking 642-811 cisco exam study guide

Chapter 3: Lesson Review Answers
Lesson 1
1. Which of the following properties and methods can be used to find the index of
a selected item in a ListBox control? (Choose all that apply.) 642-445
A. ListBox.IndexOf
B. ListBox.SelectedIndex
C. ListBox.SelectedIndices
D. ListBox.Select
1. Correct Answers: B and C
A. Incorrect. The IndexOf method returns the index of an object to which you
have a reference but does not detect selected objects.
B. Correct. The SelectedIndex property will return the selected index. Note that
if more than one item is selected, this property might return any of them.
C. Correct. The SelectedIndices property will return all selected indexes.
D. Incorrect. The Select method will programmatically select an object in the
ListBox but does not detect which index is selected. 642-456 642-513

2. Which of the following methods cannot be used to add an item to the Items col-
lection of a ComboBox, ListBox, or CheckedListBox control?
A. Items.Add
B. Items.Insert
C. Items.AddRange
D. Items.Contains
2. Correct Answer: D
A. Incorrect. The Items.Add method adds a specified item to the Items collec-
tion.
B. Incorrect. The Items.Insert method adds a specified item to the Items collec-
tion at a specified index. 642-523 642-812
C. Incorrect. The Items.AddRange method can be used to add an array of
objects to the Items collection.
D. Correct. The Items.Contains method is used to determine if a collection
contains a specified item, not to add items to a collection.

3. Which of the following is NOT a valid setting for the View property of the List-
View control?
A. LargeIcon
B. Details
C. Tree
D. SmallIcon
3. Correct Answer: C
A. Incorrect. Setting the View property to LargeIcon displays the ListViewItems
with their associated large icons.
B. Incorrect. Setting the View property to Details will display the ListViewItems
with its associated SubItems. 642-811 642-642
C. Correct. The ListView property cannot be used for displaying hierarchical
data. For items with a tree structure, use the TreeView control.
D. Incorrect. Setting the View property to SmallIcon displays the ListViewItems
with their associated small icons.

Lesson 2
1. Which of the following are possible values for the Checked property of a Check-
Box control? (Choose all that apply.)
A. Checked
B. False
C. Indeterminate
D. Unchecked
E. True
F. NotChecked
1. Correct Answers: B and E
A. Incorrect. The Checked property is a Boolean value and can be only True or
False. The CheckState property can be set to Checked, however.
B. Correct. The Checked property is a Boolean value and can be only True or
False. 642-611 642-587
C. Incorrect. The Checked property is a Boolean value and can be only True or
False. The CheckState property can be set to Indeterminate, however.
D. Incorrect. The Checked property is a Boolean value and can be only True or
False. The CheckState property can be set to Unchecked, however.
E. Correct. The Checked property is a Boolean value and can be only True or
False.
F. Incorrect. The Checked property is a Boolean value and can be only True or
False. No property of the CheckBox control can be set to NotChecked.

2. You are designing an application that asks the user to select a period ranging
from one day to seven days in a given month. Which of the following configura-
tions for a MonthCalendar control are best choices to facilitate this functionality?
(Choose all that apply.)
A. Set the MaxSelectionCount property to 7.
B. Set the SelectionRange property to the first and last days of the month in
question.
C. Set the MaxDate property to the last day of the month in question.
D. Set the MinDate property to the first day of the month in question.
2. Correct Answers: A, C, and D
A. Correct. The MaxSelectionCount property determines the number of days
that can be chosen in the SelectionRange property. 642-533
B. Incorrect. The SelectionRange property will be set to a new value when the
user chooses dates, so setting it at design time will not facilitate this scenario.
C. Correct. The MinDate property determines the earliest date that can be
chosen, so setting it to the first day of the month in question will prevent
the user from choosing any date before this day.
D. Correct. The MaxDate property determines the latest date that can be cho-
sen, so setting it to the last day of the month in question will prevent the
user from choosing any date after this day.

3. Which of the following code examples correctly associates an image from an
ImageList component with a Button control? Assume an ImageList component
named ImageList1 and a Button control named Button1. (Choose all that apply.)
A. ‘ VB
Button1.Image = ImageList1
// C#
button1.Image = imageList1;
B. ‘ VB
Button1.ImageList = ImageList1
Button1.ImageKey = ImageList1.Images(0)
// C#
button1.ImageList1 = imageList1;
button1.ImageKey = imageList1.Images(0);
C. ‘ VB
Button1.ImageList = ImageList1
Button1.ImageIndex = 0
// C#
button1.ImageList = imageList1;
button1.ImageIndex = 0;
D. ‘ VB 642-811
Button1.ImageList = ImageList1
Button1.ImageKey = “myImage”
// C#
button1.ImageIndex = imageList1;

button1.ImageKey = “myImage”;
3. Correct Answers: C and D
A. Incorrect. The Image property directly sets an image for the control and
cannot be set to an ImageList.
B. Incorrect. The ImageKey property takes a string and indicates the key for
the image in the associated ImageList component. You cannot set the
ImageKey property to a value of Image.
C. Correct. You can set the ImageList property of the control to the ImageList
in question and set the ImageIndex property to the index of the image in the
ImageList.Items collection.
D. Correct. You can set the ImageList property of the control to the ImageList
in question and set the ImageKey property to the key of the image in the
ImageList.Items collection. 642-611

Lesson 3
1. Which of the following methods can be used to print the current document in a
WebBrowser control? (Choose all that apply.)
A. WebBrowser.Print
B. WebBrowser.ShowPrintDialog
C. WebBrowser.ShowPrintPreviewDialog
D. WebBrowser.ShowPropertiesDialog
1. Correct Answers: A, B, and C
A. Correct. The Print method prints the current document.
B. Correct. The ShowPrintDialog method displays the print dialog box and
allows the user to set options before printing.
C. Correct. The ShowPrintPreview method displays the print preview dialog
box and allows the user to preview the document before printing.
D. Incorrect. The ShowPropertiesDialog method displays the properties for the
current document but does not facilitate printing.

2. You are designing an application that runs in the background and want to
enable the application to notify the user when a severe error occurs. Which of
the following properties of the NotifyIcon component can facilitate this function-
ality? (Choose all that apply.) 642-587
A. BalloonTipIcon
B. BalloonTipText
C. BalloonTipTitle
D. Text
2. Correct Answers: A, B, and C
A. Correct. The BalloonTipIcon property can be set to Error, Warning, or Info,
which can set the level of warning for the BalloonTip.
B. Correct. The BalloonTipText property can provide detailed information
about the problem to the user and suggest a possible remedy.
C. Correct. The BalloonTipTitle property can provide a clear indication of the
problem to the user.
D. Incorrect. The Text property is displayed when the user mouses over the
NotifyIcon in the system tray and should not be used for displaying critical
information.

3. Which of the following are required to create an access key for a control without
using an associated label? (Choose all that apply.) 642-432
A. The Enabled property must be set to True.
B. The control must have a Text property.
C. The UseMnemonic property must be set to True.
D. The control must be of a type that is able to receive the focus.
3. Correct Answers: B, C, and D
A. Incorrect. Although the access key will not function if the control is not
enabled, setting the Enabled property to False does not prevent the creation
of an access key at design time.
B. Correct. The Text property allows the user to define the key that is to be the
access key.
C. Correct. The UseMnemonic property indicates that the control should use
the key preceded by the ampersand (&) symbol in the Text property as the
access key.
D. Correct. If the control cannot inherently receive the focus, you cannot cre-
ate an access key for it. 642-587

Chapter 3: Case Scenario Answers
Case Scenario 1: Incorporating List-Based Controls into the User Interface
Humongous Insurance has grown so large that they need some help keeping track of
their employees. You have been put on the team that will design the new human
resources application. Other developers will supply a programmatic representation of
the organization chart and a database of information about the employees. Your job is to
create a user interface that allows the organization chart to be browsed by the user and
allows additional information about each employee to be displayed in the user interface.
Questions
Answer the following questions for your manager: 642-432
1. What is your suggested control layout for the user interface? How will you be
able to display the organization chart in a compact, easy-to-browse format?
How can we display photos of our employees as part of this application?

The primary control of this user interface would be the TreeView control, which can be
used to display hierarchical information, such as an organization chart, to the user.
Individual nodes in the organization can be expanded or collapsed, and the user can
easily browse the interface. You can use other controls to display detailed information
about a selected employee.
You can create an ImageList that contains icon photos of each employee and set the
ImageList property of the TreeView to read these images. By setting the ImageKey or
ImageIndex property of each TreeNode, an individual icon will be displayed in the Tree-
View. In the details view, you can use the PictureBox control to display a full-size image. 642-587

Case Scenario 2: Working with Files and Background Processes
As part of their document backup plan, Humongous Insurance has created an auto-
mated program that reads their electronic documents in a variety of different formats
(such as .doc, .txt, and .htm), saves them to a backup location, and prints a hard copy
on a high-throughput printer. For the most part, this application works fine without
user interaction and displays no user interface. Occasionally, however, a problem
occurs with a document that requires user intervention. You have been put in charge
of designing the user interface for the rare occasions that do arise.
Technical Requirements
■ The user interface must display only when there is a problem, and cannot be
launched without action by a user. 642-426
The user must be able to examine the document and manually save and print it.
Questions
Answer the following questions for your manager:
1. How can we warn the user of a problem without displaying the user interface at
all times? How will we allow the user to launch a user interface when there is a
problem?
2. When there is a problem, how can we design the user interface so that the user
is able to examine, print, and save individual files?

The NotifyIcon component can be used to inform the user without creating an obtru-
sive user interface. An icon in the system tray will let the user know the application is
running. If there is a problem, this can be communicated to the user through the bal-
loon tip. The BalloonTipIcon property can be set to the appropriate level (Error, Warn-
ing, or Info), and additional information can be provided to the user through the
BalloonTipText. 642-425
If launching the user interface is required, we can enable that by associating a Context-
MenuStrip with the NotifyIcon. The user can right-click the NotifyIcon and choose a
command from the context menu.
The WebBrowser component contains all of the functionality necessary to examine,
print, and save files. We can design the interface so that the user can view the file in
the WebBrowser and then call the WebBrowser.Print or WebBrowser.ShowSaveAsDialog
methods as necessary to print and save the document.

Leave a Reply