Deck 2: Visual Basic, Controls, and Events
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/61
Play
Full screen (f)
Deck 2: Visual Basic, Controls, and Events
1
Press F4 to
A) run a program.
B) display the Properties window.
C) display the Solution Explorer window.
D) terminate a program.
A) run a program.
B) display the Properties window.
C) display the Solution Explorer window.
D) terminate a program.
B
2
GUI stands for
A) graphical user interface.
B) graphing user introduction.
C) graphical unit interface.
D) graphical user input.
A) graphical user interface.
B) graphing user introduction.
C) graphical unit interface.
D) graphical user input.
A
3
What effect will the following statement have?
lblOne.Visible = False
A) Enable lblOne
B) Delete lblOne
C) Make lblOne invisible
D) It is not a valid Visual Basic statement.
lblOne.Visible = False
A) Enable lblOne
B) Delete lblOne
C) Make lblOne invisible
D) It is not a valid Visual Basic statement.
Make lblOne invisible
4
The Font dialog box allows you to select different Fonts, their style, their size, and some other special effects. How do you bring up this Font dialog box?
A) In the Properties window, click the ellipsis (…) on the right side of the settings box for the Font property.
B) Double-click the control, and select Font Property.
C) Right-click the control, and select Font Property.
D) None of the above
A) In the Properties window, click the ellipsis (…) on the right side of the settings box for the Font property.
B) Double-click the control, and select Font Property.
C) Right-click the control, and select Font Property.
D) None of the above
Unlock Deck
Unlock for access to all 61 flashcards in this deck.
Unlock Deck
k this deck
5
When a Visual Basic program is running, the user can move from one control to another using the keyboard by pressing the
A) Tab key.
B) Space bar.
C) Enter key.
D) Backspace key.
A) Tab key.
B) Space bar.
C) Enter key.
D) Backspace key.
Unlock Deck
Unlock for access to all 61 flashcards in this deck.
Unlock Deck
k this deck
6
Which of the following properties determines the words appearing in a form's title bar?
A) Text
B) Caption
C) Name
D) Title
A) Text
B) Caption
C) Name
D) Title
Unlock Deck
Unlock for access to all 61 flashcards in this deck.
Unlock Deck
k this deck
7
Sizing Handles make it very easy to resize virtually any control when developing programs with Visual Basic. When working in the Form Designer, how are these sizing handles displayed?
A) A rectangle with 4 arrows, one in each corner, around your control.
B) A 3-D outline around your control.
C) A rectangle with small squares around your control.
D) None of the above
A) A rectangle with 4 arrows, one in each corner, around your control.
B) A 3-D outline around your control.
C) A rectangle with small squares around your control.
D) None of the above
Unlock Deck
Unlock for access to all 61 flashcards in this deck.
Unlock Deck
k this deck
8
Which of the properties in a control's list of properties is used to give the control a meaningful name?
A) Text
B) ContextMenu
C) ControlName
D) Name
A) Text
B) ContextMenu
C) ControlName
D) Name
Unlock Deck
Unlock for access to all 61 flashcards in this deck.
Unlock Deck
k this deck
9
Which of the following steps specifies P as the access key for a button?
A) Set the Text property to Com_pute.
B) Set the Text property to Com&pute.
C) Set the Text property to &Com_pute.
D) Set the Text property to comPute.
A) Set the Text property to Com_pute.
B) Set the Text property to Com&pute.
C) Set the Text property to &Com_pute.
D) Set the Text property to comPute.
Unlock Deck
Unlock for access to all 61 flashcards in this deck.
Unlock Deck
k this deck
10
A mouse click is an
example of an event.
example of an event.
Unlock Deck
Unlock for access to all 61 flashcards in this deck.
Unlock Deck
k this deck
11
Visual Basic access keys are created by using which symbol in a button's Text property?
A) @
B) &
C) %
D) #
A) @
B) &
C) %
D) #
Unlock Deck
Unlock for access to all 61 flashcards in this deck.
Unlock Deck
k this deck
12
The Properties window plays an important role in the development of Visual Basic programs. It is mainly used
A) to change how objects look and feel.
B) when opening programs stored on a hard drive.
C) to allow the developer to graphically design program components.
D) to set program related options like Program Name, Program Location, etc.
A) to change how objects look and feel.
B) when opening programs stored on a hard drive.
C) to allow the developer to graphically design program components.
D) to set program related options like Program Name, Program Location, etc.
Unlock Deck
Unlock for access to all 61 flashcards in this deck.
Unlock Deck
k this deck
13
What keyboard shortcut is used to run the current program?
A) F4
B) F5
C) F6
D) F7
A) F4
B) F5
C) F6
D) F7
Unlock Deck
Unlock for access to all 61 flashcards in this deck.
Unlock Deck
k this deck
14
What would be a good name for a text box to hold a person's first name?
A) txtFirstName
B) FirstName
C) txt First Name
D) First Name
A) txtFirstName
B) FirstName
C) txt First Name
D) First Name
Unlock Deck
Unlock for access to all 61 flashcards in this deck.
Unlock Deck
k this deck
15
Programming in VB 2012 is different from traditional programming environments because first you should
A) write the code.
B) input the data.
C) name the buttons.
D) draw the user interface.
A) write the code.
B) input the data.
C) name the buttons.
D) draw the user interface.
Unlock Deck
Unlock for access to all 61 flashcards in this deck.
Unlock Deck
k this deck
16
In Visual Basic, tooltips assist by showing a small caption about the purpose of each icon on the Toolbar. How do you make a tooltip appear?
A) Right click the Toolbar icon and select purpose from the available options.
B) Position the mouse pointer over the icon for a few seconds.
C) Hold down a shift key, then click the appropriate Toolbar icon to display its purpose.
D) Hold down the Alt key, then click the appropriate Toolbar icon to display its purpose.
A) Right click the Toolbar icon and select purpose from the available options.
B) Position the mouse pointer over the icon for a few seconds.
C) Hold down a shift key, then click the appropriate Toolbar icon to display its purpose.
D) Hold down the Alt key, then click the appropriate Toolbar icon to display its purpose.
Unlock Deck
Unlock for access to all 61 flashcards in this deck.
Unlock Deck
k this deck
17
What feature in Visual Basic allows you to make more room on your screen by temporarily minimizing certain windows?
A) Help
B) Auto Hide
C) Auto Minimize
D) Expert-View
A) Help
B) Auto Hide
C) Auto Minimize
D) Expert-View
Unlock Deck
Unlock for access to all 61 flashcards in this deck.
Unlock Deck
k this deck
18
Visual Basic first appeared
about ten years ago.
about ten years ago.
Unlock Deck
Unlock for access to all 61 flashcards in this deck.
Unlock Deck
k this deck
19
Which property is available for most controls that allows you to hide/unhide them either manually by setting the property or by setting it during run time via code?
A) Clear
B) Refresh
C) Visible
D) View-Control
A) Clear
B) Refresh
C) Visible
D) View-Control
Unlock Deck
Unlock for access to all 61 flashcards in this deck.
Unlock Deck
k this deck
20
When creating a new program in Visual Basic, you are asked to supply a name for the program. If you do not specify a name, a default name is used. What is this default name?
A) Wapplication followed by a number.
B) Application followed by a number.
C) WindowsApplication.
D) WindowsApplication followed by a number.
A) Wapplication followed by a number.
B) Application followed by a number.
C) WindowsApplication.
D) WindowsApplication followed by a number.
Unlock Deck
Unlock for access to all 61 flashcards in this deck.
Unlock Deck
k this deck
21
When working with text boxes, the sizing handles allow you to resize the object by dragging to make it wider or narrower.
Unlock Deck
Unlock for access to all 61 flashcards in this deck.
Unlock Deck
k this deck
22
A group of several controls can be resized or moved simultaneously.
Unlock Deck
Unlock for access to all 61 flashcards in this deck.
Unlock Deck
k this deck
23
The Description pane, located below the Properties windows, shows a brief explanation of the highlighted property.
Unlock Deck
Unlock for access to all 61 flashcards in this deck.
Unlock Deck
k this deck
24
What is the default tab index of the first object placed on a form?
A) 0
B) 1
C) First
D) None of the above
A) 0
B) 1
C) First
D) None of the above
Unlock Deck
Unlock for access to all 61 flashcards in this deck.
Unlock Deck
k this deck
25
The Auto Hide feature of the Toolbox is active when the pushpin is horizontal.
Unlock Deck
Unlock for access to all 61 flashcards in this deck.
Unlock Deck
k this deck
26
Which of the following is not a submenu of the Format menu?
A) Align
B) Make Same Size
C) Center in Form
D) Widen
A) Align
B) Make Same Size
C) Center in Form
D) Widen
Unlock Deck
Unlock for access to all 61 flashcards in this deck.
Unlock Deck
k this deck
27
Snap lines can be used to align the bottoms, middles, and tops of controls.
Unlock Deck
Unlock for access to all 61 flashcards in this deck.
Unlock Deck
k this deck
28
F5 is the keyboard shortcut used to activate the Properties window.
Unlock Deck
Unlock for access to all 61 flashcards in this deck.
Unlock Deck
k this deck
29
Changing a control's Text property also changes how you refer to the control in code.
Unlock Deck
Unlock for access to all 61 flashcards in this deck.
Unlock Deck
k this deck
30
What property of controls tells the order they receive the focus when the tab key is pressed during run time?
A) Focus order
B) Focus number
C) Tab index
D) Control order
A) Focus order
B) Focus number
C) Tab index
D) Control order
Unlock Deck
Unlock for access to all 61 flashcards in this deck.
Unlock Deck
k this deck
31
The control with tab index 1 is always the first control to receive the focus when the program is run.
Unlock Deck
Unlock for access to all 61 flashcards in this deck.
Unlock Deck
k this deck
32
The key combination Shift + arrow key can be used to resize a control or a group of controls.
Unlock Deck
Unlock for access to all 61 flashcards in this deck.
Unlock Deck
k this deck
33
Shortcut keys like F5 (Run), allow you to perform certain tasks without the use of the mouse.
Unlock Deck
Unlock for access to all 61 flashcards in this deck.
Unlock Deck
k this deck
34
The Properties window is used to change how objects look and react.
Unlock Deck
Unlock for access to all 61 flashcards in this deck.
Unlock Deck
k this deck
35
What property of a control determines whether the control can receive the focus during run time?
A) TabOrder
B) Focus
C) TabIndex
D) TabStop
A) TabOrder
B) Focus
C) TabIndex
D) TabStop
Unlock Deck
Unlock for access to all 61 flashcards in this deck.
Unlock Deck
k this deck
36
The ForeColor property of a text box changes the color of the form containing the text box.
Unlock Deck
Unlock for access to all 61 flashcards in this deck.
Unlock Deck
k this deck
37
Once a text box control is placed on a form, it cannot be resized or moved.
Unlock Deck
Unlock for access to all 61 flashcards in this deck.
Unlock Deck
k this deck
38
You can display the Properties window by pressing F4.
Unlock Deck
Unlock for access to all 61 flashcards in this deck.
Unlock Deck
k this deck
39
The recommended prefix for the name of a button control is btn.
Unlock Deck
Unlock for access to all 61 flashcards in this deck.
Unlock Deck
k this deck
40
Once a control is placed on your form, you can rename it by editing the Name property in the Properties window.
Unlock Deck
Unlock for access to all 61 flashcards in this deck.
Unlock Deck
k this deck
41
Complete Word is a helpful feature produced by the Microsoft Technology called IntelliSense.
Unlock Deck
Unlock for access to all 61 flashcards in this deck.
Unlock Deck
k this deck
42
The statement
btnButton.Focus
A) has no effect.
B) moves the focus to the button btnButton.
C) has the same effect as clicking on the button btnButton.
D) is invalid in Visual Basic.
btnButton.Focus
A) has no effect.
B) moves the focus to the button btnButton.
C) has the same effect as clicking on the button btnButton.
D) is invalid in Visual Basic.
Unlock Deck
Unlock for access to all 61 flashcards in this deck.
Unlock Deck
k this deck
43
When will the following event procedure be executed?
Private Sub txtBox_TextChanged(...) Handles txtBox.TextChanged
A) when text is added to the text box
B) when text is deleted from the text box
C) when text is modified inside the text box
D) All of the above
Private Sub txtBox_TextChanged(...) Handles txtBox.TextChanged
A) when text is added to the text box
B) when text is deleted from the text box
C) when text is modified inside the text box
D) All of the above
Unlock Deck
Unlock for access to all 61 flashcards in this deck.
Unlock Deck
k this deck
44
The Visual Basic Code Editor automatically capitalizes the first letters of reserved words.
Unlock Deck
Unlock for access to all 61 flashcards in this deck.
Unlock Deck
k this deck
45
The statement btnButton = "Press" produces an error message.
Unlock Deck
Unlock for access to all 61 flashcards in this deck.
Unlock Deck
k this deck
46
Which of the following statements sets the words on a button to "Push Me"?
A) btnButton.Name = "Push Me"
B) btnButton.Text = Push Me
C) btnButton.Text = "Push Me"
D) btnButton = "Push Me"
A) btnButton.Name = "Push Me"
B) btnButton.Text = Push Me
C) btnButton.Text = "Push Me"
D) btnButton = "Push Me"
Unlock Deck
Unlock for access to all 61 flashcards in this deck.
Unlock Deck
k this deck
47
IntelliSense is a technology built into Visual Basic that assists the programmer by
A) automatically inserting text and words that have similar meaning to those currently being entered by the programmer.
B) allowing the programmer to edit object properties from inside the code window.
C) replacing misspelled words with the correct spelling as soon as the programmer presses the Enter key.
D) automatically displaying the methods and properties available to a control.
A) automatically inserting text and words that have similar meaning to those currently being entered by the programmer.
B) allowing the programmer to edit object properties from inside the code window.
C) replacing misspelled words with the correct spelling as soon as the programmer presses the Enter key.
D) automatically displaying the methods and properties available to a control.
Unlock Deck
Unlock for access to all 61 flashcards in this deck.
Unlock Deck
k this deck
48
Visual Basic responds to events using which of the following?
A) a code procedure
B) an event procedure
C) a form procedure
D) a property
A) a code procedure
B) an event procedure
C) a form procedure
D) a property
Unlock Deck
Unlock for access to all 61 flashcards in this deck.
Unlock Deck
k this deck
49
What of the following is a correct statement for specifying the words to appear in the title bar of Form1?
A) Form1.Text = "My Text"
B) Form1.TitleBar = "My Text"
C) Me.Text = "My Text"
D) Me.Caption = "My Text"
A) Form1.Text = "My Text"
B) Form1.TitleBar = "My Text"
C) Me.Text = "My Text"
D) Me.Caption = "My Text"
Unlock Deck
Unlock for access to all 61 flashcards in this deck.
Unlock Deck
k this deck
50
The first line of an event procedure must contain both the keyword Sub and Handles.
Unlock Deck
Unlock for access to all 61 flashcards in this deck.
Unlock Deck
k this deck
51
A user action such as clicking a button is called
A) an accident
B) an event
C) a procedure
D) a property
A) an accident
B) an event
C) a procedure
D) a property
Unlock Deck
Unlock for access to all 61 flashcards in this deck.
Unlock Deck
k this deck
52
Which of the following statements will place "Greetings" in the title bar of a form?
A) Me.Title = "Greetings"
B) Me.Text = "Greetings"
C) Me.Name = "Greetings"
D) Me.Heading = "Greetings"
A) Me.Title = "Greetings"
B) Me.Text = "Greetings"
C) Me.Name = "Greetings"
D) Me.Heading = "Greetings"
Unlock Deck
Unlock for access to all 61 flashcards in this deck.
Unlock Deck
k this deck
53
The statement
txtBox.Font.Bold = True
will produce an error message when Visual Basic tries to execute it.
txtBox.Font.Bold = True
will produce an error message when Visual Basic tries to execute it.
Unlock Deck
Unlock for access to all 61 flashcards in this deck.
Unlock Deck
k this deck
54
When the user clicks a button,___________ is raised.
A) an event
B) a method
C) a setting
D) a property
A) an event
B) a method
C) a setting
D) a property
Unlock Deck
Unlock for access to all 61 flashcards in this deck.
Unlock Deck
k this deck
55
Which of the following is a valid statement in Visual Basic?
A) Form1.Text = "Revenue"
B) Form1.Caption = "Revenue"
C) btnButton.Text = Push Me
D) Me.Text = "Revenue"
A) Form1.Text = "Revenue"
B) Form1.Caption = "Revenue"
C) btnButton.Text = Push Me
D) Me.Text = "Revenue"
Unlock Deck
Unlock for access to all 61 flashcards in this deck.
Unlock Deck
k this deck
56
The Visual Basic Code Editor will automatically detect certain types of errors as you are entering code.
Unlock Deck
Unlock for access to all 61 flashcards in this deck.
Unlock Deck
k this deck
57
Keywords are also referred to as reserved words.
Unlock Deck
Unlock for access to all 61 flashcards in this deck.
Unlock Deck
k this deck
58
Which of the following is not one of the three steps used to create a Visual Basic program?
A) create the interface
B) set the properties of the objects
C) specify the methods
D) write the code
A) create the interface
B) set the properties of the objects
C) specify the methods
D) write the code
Unlock Deck
Unlock for access to all 61 flashcards in this deck.
Unlock Deck
k this deck
59
The following lines of code are valid.
Private Sub Click(...) Handles Click
txtBox.Text = ""
End Sub
Private Sub Click(...) Handles Click
txtBox.Text = ""
End Sub
Unlock Deck
Unlock for access to all 61 flashcards in this deck.
Unlock Deck
k this deck
60
Which of the following statements specifies that the color of the text in txtBox be red?
A) txtBox.Text = Color.Red
B) txtBox.ForeColor = Color.Red
C) txtBox.ForeColor = Red
D) txtBox = Color.Red
A) txtBox.Text = Color.Red
B) txtBox.ForeColor = Color.Red
C) txtBox.ForeColor = Red
D) txtBox = Color.Red
Unlock Deck
Unlock for access to all 61 flashcards in this deck.
Unlock Deck
k this deck
61
The Properties window cannot be used to display the events associated with a control.
Unlock Deck
Unlock for access to all 61 flashcards in this deck.
Unlock Deck
k this deck