Windows-based application code segment

You develop a Windows-based application that includes the following code segment. (Line numbers are
included for reference only.)
01 Public Sub password_Validating (ByVal sender As _
02 Object, ByVal e As _
03 System.ComponentModel.CancelEventArgs)
04 Handles password.Validating
05 If ValidPassword() = False Then
06 'Insert new code.
07 End If
08 End Sub
You must ensure that users cannot move control focus away from textPassword if ValidPassword returns a value of False. You will add the required code on line 6.
Which code segment should you use?

A. e.Cancel = True

B. sender = textName

C. password.AcceptsTab = False

D. password.CausesValidation =False

Questions by Sudiya   answers by Sudiya

Showing Answers 1 - 9 of 9 Answers

sed0424

  • Apr 24th, 2009
 

If e is defined as System.ComponentModel.CancelEventArgs, e As System.ComponentModel.CancelEventArgs, then e.cancel is correct

  Was this answer useful?  Yes

e.cancle = True

If the input in the control does not fall within required parameters,the property within your event handler can be used to cancel the Validating event and return the focus to the control.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions