(!IsValidPhone()) {
errorProvider1.GetError(textPhone);}}
D. private void textPhone_Validated(object sender, System.EventArgs e) {if (!IsValidPhone())
{errorProvider1.GetError(textPhone);
}}
E. private void textPhone_Validating(object sender, System.ComponentModel.CancelEventArgs e) {if
(!IsValidPhone()) {
errorProvider1.UpdateBinding();}}
F. private void textPhone_Validated(object sender, System.EventArgs e) {if (!IsValidPhone())
{errorProvider1.UpdateBinding();}}
Answer: A
Explanation: The Validating event allows you to perform sophisticated validation on controls. It is possible to
use an event handler that doesn't allow the focus to leave the control until a value has been entered. The
ErrorProvider component provides an easy way to communicate validation
errors to users. The Set Error method of the ErrorProvider class sets the error description string for the specified
control.
Note: Focus events occur in the following order:
1. Enter
2. Got Focus
3. Leave
4. Validating
5. Validated
6. Lost Focus
Reference: 70-306/70-316 Training kit, To create a validation handler that uses the ErrorProvidercomponent,
Pages 93-94 .NET Framework Class Library, ErrorProvider.SetError Method [C#]
Incorrect Answers
C: The Get Error method returns the current error description string for the specified control.
E: The update Binding method provides a method to update the bindings of the DataSource,DataMember, and
the error text. However, we just want to set the error description.
B, D, F: The validated event occurs when the control is finished validating. It can used to perform any actions
based upon the validated input.
QUESTION .116 You develop a Windows-based application CertkillerApp that includes several menus. Every
exclusive. You decide to distinguish the single most important item in each menu by changing its caption text to
bold type. What should you do?
A. Set the Default Item property to True.
B. Set the Text property to "True".
C. Set the Checked property to True.
D. Set the Owner Draw property to True.
Answer: A
Explanation: Gets or sets a value indicating whether the menu item is the default menu item. The default menu
item for a menu is boldfaced.
Reference: .NET Framework Class Library, MenuItem.DefaultItem Property [C#]
Incorrect Answers
B: The Text property contains the text that is associated with the control. We cannot format this text by HTML-
Actualtests.com - The Power of Knowing
070-316
like tags in the text.
C: We don't want the menu-item to be selected, just bold.
D: When the Owner Draw property is set to true, you need to handle all drawing of the menu item. You can use
this capability to create your own special menu displays.
QUESTION .117 You use Visual Studio .NET to develop a Windows-based application. The application
includes several menu controls that provide access to most of the application's functionality. One menu option is
named calculate Option. When a user chooses this option, the application
will perform a series of calculations based on information previously entered by the user. To provide user
assistance, you create a TextBox control named CertkillerHelp. The corresponding text box must display help
information when the user pauses on the menu option with a mouse or navigates to the option by using the
arrow keys. You need to add the following code segment:In which event should you add this code segment?
A. calculateOption_Click
B. calculateOption_Popup
C. calculateOption_Select
D. calculateOption_DrawItem
E. calculateOption_MeasureItem
Answer: C
Explanation: The Select event is raised when a menu item is highlighted. We should use the Select event to set
the helper text.
Reference: 70-306/70-316 Training kit, Using Menu Item Events, Page 79
Incorrect Answers
A: The Click event occurs when a menu item is selected.
B: The Popup event is raised just before a menu item's list of menu items is displayed. It can be used to enable
and disable menu items at run time before the menu is displayed.
D: The Draw Item event handler provides a Graphics object that enables you to perform drawing and other
graphical operations on the surface of the menu item.
E: The Measure Item event occurs when the menu needs to know the size of a menu item before drawing it.
QUESTION .118 You develop a Windows-based application that includes the following code segment. (Line
numbers are included for reference only.)
01 private void Password_Validating(object sender,
02 System.ComponentModel.CancelEventArgs e)
03 {
04 if (ValidCertkillerPassword() == false)
05 {
06 //Insert new code.
07 }
08 }You must ensure that users cannot move control focus away from text Password ifValidCertkillerPassword
returns a value of False. You will add the required code on line6.
A. e.Cancel = true;
B. sender = name;
C. password.AcceptsTab = false;
D. password.CausesValidation = false;
Answer: A
Explanation: If the input in the control does not fall within required parameters, the Cancel property within your
Actualtests.com - The Power of Knowing
070-316
event handler can be used to cancel the Validating event and return the focus to the control.
Reference: 70-306/70-316 Training kit, The Validating and Validated Events, Page 89
Incorrect Answers
B: Setting an object to an unknown variable is rubbish.
C: The AccptsTab property gets or sets a value indicating whether pressing the TAB key in a multiline text box
control types a TAB character in the control instead of moving the focus to the next control in the tab order.
D: The Causes Validation property gets or sets a value indicating whether validation is performed when the
Button control is clicked.
QUESTION .119 You use Visual Studio .NET to develop a Windows-based application that will interact with
a Microsoft SQL Server database. Your application will display employee information from a table named
CertkillerEmployees. You use ADO.NET to access the data from the database.
To limit the possibility of errors, you must ensure that any type of mismatch errors between your application
code and the database are caught at compile time rather than at run time. Which two actions should you take?
(Each correct answer presents part of the solution. (Choose two)
A. Create an XML schema for CertkillerEmployees.
B. Create an XML style sheet for CertkillerEmployees.
C. Create an XML namespace for CertkillerEmployees.
D. Create a typed DataSet object based on the XML schema.
E. Create a typed DataSet object based on the XML style sheet.
F. Create a TypeDelegator class based on the XML namespace.
Answer: A, D
Explanation:
A: We need to create an XML schema that describes the structure of the data. : From this XML schema we can
create a typed DataSet object.
Incorrect Answers
B, E: There is no such thing as an XML style sheet. [ Pobierz całość w formacie PDF ]