Deck 7: Multiple Forms, Modules, and Menus

Full screen (f)
exit full mode
Question
When a ______form is displayed, no other form in the application can receive the focus until the form is closed.

A) hidden
B) modeless
C) modal
D) show
Use Space or
up arrow
down arrow
to flip the card.
Question
The _______event occurs when a form is in the process of closing, but before it has closed.

A) FormClosing
B) FormClosed
C) CloseForm
D) Close
Question
All of the following are true of the Show method of a form except:

A) using the Show method allows other forms to receive the focus
B) the Show method allows a calling program to continue to process statements
C) the displayed form must be closed before you can access other forms
D) the Show method displays a modeless form
Question
In order to prevent users from accessing a menu item, set the item's _____property to _______.

A) Enabled, False
B) Disabled, True
C) Active, False
D) Hidden, True
Question
In order to add a menu to a form, you must place a ______on the form.

A) MenuCommand control
B) MenuItem control
C) MenuOption control
D) MenuStrip control
Question
When creating a form in Visual Basic, code associated with that form is stored in a file with a _extension.

A) sln
B) proj
C) frm
D) vb
Question
A module-level variable declared Public is also known as a ______variable.

A) private
B) access
C) global
D) universal
Question
All of the following are true about the Hide method of a form except:

A) Using the Hide method removes the form from memory.
B) The Hide method makes the form invisible.
C) Once you have called the Hide method, the form can be redisplayed with the ShowDialog method.
D) Once you have called the Hide method, the form can be redisplayed with the Show method.
Question
Which of the following is not true about a form's Activated event?

A) It occurs when a form is initially displayed.
B) It occurs each time a form regains the focus.
C) It occurs each time the user clicks a form that does not have the focus.
D) It occurs before the Load event procedure is processed.
Question
A variable is accessible to statements outside the form if declared __________.

A) as private and class-level
B) as public
C) as public and class-level
D) with a Dim statement
Question
Which of the following statements disables the Copy menu item named mnuCopy?

A) mnuCopy.Disabled = True
B) mnuCopy.Enabled = False
C) mnuCopy.Active = False
D) mnuCopy.Disable
Question
A form's ______event is triggered when the user switches to the form from another form or another application.

A) form load
B) activated
C) got focus
D) click
Question
All of the following are true about standard modules except __________.

A) A module is a file that contains code such as variable declarations and procedures
B) A public variable declared in a standard module may be referenced by methods located anywhere in the application.
C) Standard modules may contain event handlers
D) Standard modules are not associated with a particular form
Question
An instance of a form is created using a ______statement with the New keyword.

A) Dim
B) Open
C) Instantiate
D) Create
Question
How do you insert a separator bar into a menu?

A) Type a hyphen (−) as a menu item's Text property.
B) Type a space as a menu item's Text property
C) Assign True to the Separator property
D) Right-click an existing item and select Bar from the pop-up menu
Question
Which of the following statements most accurately describes the Me keyword?

A) The Me keyword refers to the current instance of the form.
B) Me is another name for the Form Load event procedure.
C) The Me.Close() statement calls the Close method of a form named Me.
D) The Me keyword provides access to the controls of a form without naming the specific control.
Question
Which of the following is not true about a form's class declaration?

A) It contains a detailed description of a form.
B) It's similar to a blueprint for a house.
C) It creates an instance of the form.
D) It contains the form's event handlers.
Question
Standard modules are saved on disk as files that end with this extension.

A) .mod
B) .proj
C) .frm
D) .vb
Question
What is the best way to share functions across more than one project?

A) Create the functions in one project, then copy and paste them into other projects that need them.
B) Place the code for the functions in a module and add that module to each project.
C) Place the code for the functions in the startup form of each project.
D) Place the code inside a main procedure with a public access specifier for each function.
Question
When a VB application executes, its ______is automatically displayed.

A) main sub
B) startup form
C) event procedure
D) form load event
Question
The best approach to move a menu item with an existing Click event to a new location is:

A) cut the menu item from the old location and paste it into the new location.
B) click the menu item and drag it to the new location
C) delete the menu item from the old location and add it to the new location
D) none of the above
Question
A context menu __________.

A) is an alternative for buttons
B) is shown when the user right-clicks a form or control
C) uses the MainMenu control
D) both a and c are correct
Question
Any form in a Windows Forms application can be designated as the startup form.
Question
Explain the nature of the reference to errorForm in the following code: Dim errorForm As New frmError()

A) class name
B) form name
C) class program
D) object variable
Question
Once you create a form, you do not have to re-create it to use it in another project.
Question
The last form created for a Windows Forms application is designated as the startup form.
Question
An event handler for a menu item is created by __________.

A) manually declaring the event handler
B) right-clicking the menu item
C) starting the menu designer, and then double-clicking the menu item
D) clicking the menu item
Question
A menu item may be executed by a user in each of the following ways except __________.

A) by pressing access keys such as Alt + F
B) by pressing shortcut keys such as Ctrl + S
C) by clicking on the item
D) by hovering the mouse over the item
Question
Choose the statement below that performs the comment found on line 2 of the following code segment. Dim newStudentForm As New frmNewStudent()
'Initialize AcademicYear text box on NewStudent form to 1
NewStudentForm.ShowDialog()

A) frmNewStudent.txtAcademicYear.Text = "1"
B) txtAcademicYear.Text.newStudentForm = "1"
C) newStudentForm.txtAcademicYear.Text = "1"
D) txtAcademicYear.frmNewStudent = "1"
Question
What is the result of the following section of code? Private Sub btnExit_Click(ByVal sender As System.Object, _
ByVal e as System.EventArgs) Handles btnExit.Click
Me)Close()
End Sub

A) Shut down the computer
B) Log off the current user
C) Close the current form
D) None of the above
Question
When a menu control's _____property equals True, a check appears next to the menu item.

A) showCheck
B) Checked
C) Check
D) none of the above
Question
What property must be set on a menu item to have the user activate that option by pressing Ctrl + C on the keyboard?

A) ShortcutKeys
B) QuickKey
C) HotKey
D) ShowShortCut
Question
The best way to maintain consistency when renaming a form is to __________.

A) change the form's Name property
B) change the form's filename in the Solution Explorer window
C) click Project on the menu bar, and then select Change Windows Form
D) change the form's name in the form's class declaration
Question
The primary reason to use standard menu items, such as File, Edit, and Help is ______.

A) these are built into Visual Basic
B) they are the only items that Visual Basic allows you add to a menu
C) all the examples in the book are set up this way
D) most users expect to see these items
Question
Which of the following statements will display the getStudentDataForm form in such a way that any code following the statement will not execute until the getStudentDataForm closes?

A) getStudentDataForm.Open()
B) getStudentDataForm.Show()
C) getStudentDataForm.ShowDialog()
D) getStudentDataForm.OpenForm.Modal()
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/35
auto play flashcards
Play
simple tutorial
Full screen (f)
exit full mode
Deck 7: Multiple Forms, Modules, and Menus
1
When a ______form is displayed, no other form in the application can receive the focus until the form is closed.

A) hidden
B) modeless
C) modal
D) show
C
2
The _______event occurs when a form is in the process of closing, but before it has closed.

A) FormClosing
B) FormClosed
C) CloseForm
D) Close
A
3
All of the following are true of the Show method of a form except:

A) using the Show method allows other forms to receive the focus
B) the Show method allows a calling program to continue to process statements
C) the displayed form must be closed before you can access other forms
D) the Show method displays a modeless form
C
4
In order to prevent users from accessing a menu item, set the item's _____property to _______.

A) Enabled, False
B) Disabled, True
C) Active, False
D) Hidden, True
Unlock Deck
Unlock for access to all 35 flashcards in this deck.
Unlock Deck
k this deck
5
In order to add a menu to a form, you must place a ______on the form.

A) MenuCommand control
B) MenuItem control
C) MenuOption control
D) MenuStrip control
Unlock Deck
Unlock for access to all 35 flashcards in this deck.
Unlock Deck
k this deck
6
When creating a form in Visual Basic, code associated with that form is stored in a file with a _extension.

A) sln
B) proj
C) frm
D) vb
Unlock Deck
Unlock for access to all 35 flashcards in this deck.
Unlock Deck
k this deck
7
A module-level variable declared Public is also known as a ______variable.

A) private
B) access
C) global
D) universal
Unlock Deck
Unlock for access to all 35 flashcards in this deck.
Unlock Deck
k this deck
8
All of the following are true about the Hide method of a form except:

A) Using the Hide method removes the form from memory.
B) The Hide method makes the form invisible.
C) Once you have called the Hide method, the form can be redisplayed with the ShowDialog method.
D) Once you have called the Hide method, the form can be redisplayed with the Show method.
Unlock Deck
Unlock for access to all 35 flashcards in this deck.
Unlock Deck
k this deck
9
Which of the following is not true about a form's Activated event?

A) It occurs when a form is initially displayed.
B) It occurs each time a form regains the focus.
C) It occurs each time the user clicks a form that does not have the focus.
D) It occurs before the Load event procedure is processed.
Unlock Deck
Unlock for access to all 35 flashcards in this deck.
Unlock Deck
k this deck
10
A variable is accessible to statements outside the form if declared __________.

A) as private and class-level
B) as public
C) as public and class-level
D) with a Dim statement
Unlock Deck
Unlock for access to all 35 flashcards in this deck.
Unlock Deck
k this deck
11
Which of the following statements disables the Copy menu item named mnuCopy?

A) mnuCopy.Disabled = True
B) mnuCopy.Enabled = False
C) mnuCopy.Active = False
D) mnuCopy.Disable
Unlock Deck
Unlock for access to all 35 flashcards in this deck.
Unlock Deck
k this deck
12
A form's ______event is triggered when the user switches to the form from another form or another application.

A) form load
B) activated
C) got focus
D) click
Unlock Deck
Unlock for access to all 35 flashcards in this deck.
Unlock Deck
k this deck
13
All of the following are true about standard modules except __________.

A) A module is a file that contains code such as variable declarations and procedures
B) A public variable declared in a standard module may be referenced by methods located anywhere in the application.
C) Standard modules may contain event handlers
D) Standard modules are not associated with a particular form
Unlock Deck
Unlock for access to all 35 flashcards in this deck.
Unlock Deck
k this deck
14
An instance of a form is created using a ______statement with the New keyword.

A) Dim
B) Open
C) Instantiate
D) Create
Unlock Deck
Unlock for access to all 35 flashcards in this deck.
Unlock Deck
k this deck
15
How do you insert a separator bar into a menu?

A) Type a hyphen (−) as a menu item's Text property.
B) Type a space as a menu item's Text property
C) Assign True to the Separator property
D) Right-click an existing item and select Bar from the pop-up menu
Unlock Deck
Unlock for access to all 35 flashcards in this deck.
Unlock Deck
k this deck
16
Which of the following statements most accurately describes the Me keyword?

A) The Me keyword refers to the current instance of the form.
B) Me is another name for the Form Load event procedure.
C) The Me.Close() statement calls the Close method of a form named Me.
D) The Me keyword provides access to the controls of a form without naming the specific control.
Unlock Deck
Unlock for access to all 35 flashcards in this deck.
Unlock Deck
k this deck
17
Which of the following is not true about a form's class declaration?

A) It contains a detailed description of a form.
B) It's similar to a blueprint for a house.
C) It creates an instance of the form.
D) It contains the form's event handlers.
Unlock Deck
Unlock for access to all 35 flashcards in this deck.
Unlock Deck
k this deck
18
Standard modules are saved on disk as files that end with this extension.

A) .mod
B) .proj
C) .frm
D) .vb
Unlock Deck
Unlock for access to all 35 flashcards in this deck.
Unlock Deck
k this deck
19
What is the best way to share functions across more than one project?

A) Create the functions in one project, then copy and paste them into other projects that need them.
B) Place the code for the functions in a module and add that module to each project.
C) Place the code for the functions in the startup form of each project.
D) Place the code inside a main procedure with a public access specifier for each function.
Unlock Deck
Unlock for access to all 35 flashcards in this deck.
Unlock Deck
k this deck
20
When a VB application executes, its ______is automatically displayed.

A) main sub
B) startup form
C) event procedure
D) form load event
Unlock Deck
Unlock for access to all 35 flashcards in this deck.
Unlock Deck
k this deck
21
The best approach to move a menu item with an existing Click event to a new location is:

A) cut the menu item from the old location and paste it into the new location.
B) click the menu item and drag it to the new location
C) delete the menu item from the old location and add it to the new location
D) none of the above
Unlock Deck
Unlock for access to all 35 flashcards in this deck.
Unlock Deck
k this deck
22
A context menu __________.

A) is an alternative for buttons
B) is shown when the user right-clicks a form or control
C) uses the MainMenu control
D) both a and c are correct
Unlock Deck
Unlock for access to all 35 flashcards in this deck.
Unlock Deck
k this deck
23
Any form in a Windows Forms application can be designated as the startup form.
Unlock Deck
Unlock for access to all 35 flashcards in this deck.
Unlock Deck
k this deck
24
Explain the nature of the reference to errorForm in the following code: Dim errorForm As New frmError()

A) class name
B) form name
C) class program
D) object variable
Unlock Deck
Unlock for access to all 35 flashcards in this deck.
Unlock Deck
k this deck
25
Once you create a form, you do not have to re-create it to use it in another project.
Unlock Deck
Unlock for access to all 35 flashcards in this deck.
Unlock Deck
k this deck
26
The last form created for a Windows Forms application is designated as the startup form.
Unlock Deck
Unlock for access to all 35 flashcards in this deck.
Unlock Deck
k this deck
27
An event handler for a menu item is created by __________.

A) manually declaring the event handler
B) right-clicking the menu item
C) starting the menu designer, and then double-clicking the menu item
D) clicking the menu item
Unlock Deck
Unlock for access to all 35 flashcards in this deck.
Unlock Deck
k this deck
28
A menu item may be executed by a user in each of the following ways except __________.

A) by pressing access keys such as Alt + F
B) by pressing shortcut keys such as Ctrl + S
C) by clicking on the item
D) by hovering the mouse over the item
Unlock Deck
Unlock for access to all 35 flashcards in this deck.
Unlock Deck
k this deck
29
Choose the statement below that performs the comment found on line 2 of the following code segment. Dim newStudentForm As New frmNewStudent()
'Initialize AcademicYear text box on NewStudent form to 1
NewStudentForm.ShowDialog()

A) frmNewStudent.txtAcademicYear.Text = "1"
B) txtAcademicYear.Text.newStudentForm = "1"
C) newStudentForm.txtAcademicYear.Text = "1"
D) txtAcademicYear.frmNewStudent = "1"
Unlock Deck
Unlock for access to all 35 flashcards in this deck.
Unlock Deck
k this deck
30
What is the result of the following section of code? Private Sub btnExit_Click(ByVal sender As System.Object, _
ByVal e as System.EventArgs) Handles btnExit.Click
Me)Close()
End Sub

A) Shut down the computer
B) Log off the current user
C) Close the current form
D) None of the above
Unlock Deck
Unlock for access to all 35 flashcards in this deck.
Unlock Deck
k this deck
31
When a menu control's _____property equals True, a check appears next to the menu item.

A) showCheck
B) Checked
C) Check
D) none of the above
Unlock Deck
Unlock for access to all 35 flashcards in this deck.
Unlock Deck
k this deck
32
What property must be set on a menu item to have the user activate that option by pressing Ctrl + C on the keyboard?

A) ShortcutKeys
B) QuickKey
C) HotKey
D) ShowShortCut
Unlock Deck
Unlock for access to all 35 flashcards in this deck.
Unlock Deck
k this deck
33
The best way to maintain consistency when renaming a form is to __________.

A) change the form's Name property
B) change the form's filename in the Solution Explorer window
C) click Project on the menu bar, and then select Change Windows Form
D) change the form's name in the form's class declaration
Unlock Deck
Unlock for access to all 35 flashcards in this deck.
Unlock Deck
k this deck
34
The primary reason to use standard menu items, such as File, Edit, and Help is ______.

A) these are built into Visual Basic
B) they are the only items that Visual Basic allows you add to a menu
C) all the examples in the book are set up this way
D) most users expect to see these items
Unlock Deck
Unlock for access to all 35 flashcards in this deck.
Unlock Deck
k this deck
35
Which of the following statements will display the getStudentDataForm form in such a way that any code following the statement will not execute until the getStudentDataForm closes?

A) getStudentDataForm.Open()
B) getStudentDataForm.Show()
C) getStudentDataForm.ShowDialog()
D) getStudentDataForm.OpenForm.Modal()
Unlock Deck
Unlock for access to all 35 flashcards in this deck.
Unlock Deck
k this deck
locked card icon
Unlock Deck
Unlock for access to all 35 flashcards in this deck.