Sie sind auf Seite 1von 4

16.

You want to write code that removes a form from the screen, but still be
able to access controls on that form, how do you accomplish this?

Me.Hide()

17. You have written a function, named InRange. This function determines whe
ther a value is within a range of numbers. You call the function from code in on
ly one form. Do you store the function in the Form or Standard Module?
Standard Module.

18. What is bounds checking?


Mean that it does not allow a statement to use a subscript outside the range of
valid subscripts for any array.

19. How do you change the startup object of a solution.


20.
With a project selected in Solution explore, on the Project menu, click Properti
es then click Application tab then Select a startup object from startup object o
r startup prom drop-down list.
21. What does the Me Keyword indicate
The Me keyword is used any time we want our code to refer to methods within the
current object.

For questions 21 through 30, please fill in the blank.


22. The _Dim _____________ keyword is used to create a new instance of a for
m
23. When a ____Modal form_________________ form is displayed, no other form
in the application can receive focus until the form is closed
24. A(n) _____Array___________ is a data type that you create, containing on
e or more variables, which are known as fields.
25. A _______Context Menu________ is a pop-up menu that is displayed when th
e user right-clicks a form or a control.
26. If you wish to make a class level variable available to statements outsi
de the module, then you must declare that variable with the Public_____________
__ key word.
27. Visual Basic.NET allows you to create a Sub procedure named _______Main(
)___ as an applications startup object.
28. The _____ReDim_________________ statement can be used to change the size
of an array at run time.
29. A variable that is declared as Public is also known as a Class level____
_______ variable
30. The _______Timer________________ control allows an application to automa
tically execute code at regular intervals.
31. The default access specifier for a procedure is _________Friend_________

For questions 31 through 40, please select the most correct answer.
32. Array bounds checking occurs at (A)
a. Run Time
b. Design Time
c. Break Time
d. All of the Above
33. This is the lower subscript of an array. (C)
a. 1
b. {}
c. 0
d. -1
34. This property causes a form to be displayed on top of all other currentl
y displayed forms. (A)
a. TopMost
b. Top
c. OnTop
d. Front

35. Which event of the Menu Item Object is most commonly used to execute cod
e? (B)
a. Popup
b. Click
c. Select
d. Perform
36. To create a separator bar in a Menu you would use what? (B)
a. underscore
b. hyphen
c. space
d. asterisk
37. Just before a form is initially displayed, this event is triggered.
(B)
a. Initial Display
b. Load
c. Display
d. Create
38. If you designate the Sub Procedure Main as the startup object, where mus
t it reside.
(A)
a. In the form that is also designated as the startup object
b. In the form’s Load procedure
c. In a standard module
d. In the frmMain module
39. The ___C____________________ method removes a form from the memory and t
he screen.
a. Remove
b. Delete
c. Close
d. Hide
40. Assuming that ofdOpen is an OpenFileDialog Control, the following statem
ent displays the dialog box.
(D)
a. ofd.Open.Display()
b. Show(ofdOpen)
c. ofdOpen.OpenDialog()
d. ofdOpen.ShowDialog()

41. Which of the following statements will close all the open forms and term
inate the application (C)
a. Me.Exit
b. Me.Close
c. Application.Exit
d. Application.Close

For questions 41 through 45 please write a line of code that will perform the de
scribed action.
42. Write a line of code that will Close the current form.

Me.Close()
43. Write a line of code to deselect a RadioButton named btnBlue.
btnBlue.Checked = False

44. Write a line of code that will declare and implicitly initialize an arra
y named MyArray to “Tom”, “Dick” and “Harry”
Dim strMyArray () As String = {“Tom”, “Dick”, “Harry”}

45. Write a line of code that will display a Color Dialog Box in modeless fo
rm. The name of the Color Dialog Box is ofdColor.
ofdColor.ShowDialog()

46. Write a line of code to create an instance of a form named Form2


Dim frmForm2 as New Form2

For questions 46 through 50 please indicate what is wrong with the code.
47. What is wrong with the following code?
Dim ManOfTheYear(1970 to 2000)
(1970 to 2000)
suppose not to have space on it.

48. What is wrong with the following code.


Dim MyForm as New Form2
Form2.ShowDialog
It does not have frm
It does not have ()
. as suppose to be As

49. What is wrong with the following code.


Dim Values(5) As Integer
Dim I As Integer
For I = 0 to 10
Values(I) = 10
Next I
Suppose to be Dim intValues(5) As Integer
Suppose to be Dim intI As Integer
For intI = 0 to 4 suppose to be like this
NextI suppose to be Next
50. What is wrong with the following code?
Dim MyArray(-1) as Integer
Suppose to be like this
Dim intMyArray(0 or >) As integer
51. What is wrong with the following code?
Hide Me
Me.Hide()

Das könnte Ihnen auch gefallen