Deck 7: Multiple Forms, Modules, and Menus

Full screen (f)
exit full mode
Question
A module-level variable declared Public is also known as a _variable.

A) private
B) access
C) global
D) universal
Use Space or
up arrow
down arrow
to flip the card.
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
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
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
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
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
If the user should not be able to access an item that appears on a menu, set its property to __.

A) Enabled, False
B) Disabled, True
C) Active, False
D) Hidden, True
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
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 used by other files in a project
C) Standard modules may contain event handlers
D) Standard modules are not associated with a particular form
Question
Standard modules are saved on disk as files that end with this extension.

A) .mod
B) .proj
C) .frm
D) .vb
Question
When a project executes, its _is automatically displayed.

A) main sub
B) startup form
C) event procedure
D) form load event
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
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
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
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
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
It's possible to prevent a form from closing by setting __________ in the FormClosing event handler.

A) e.Close = False
B) Close.Cancel = True
C) e.Cancel = True
D) It's not possible to prevent a form from being closed.
Question
An instance of a form is created using a _statement with the New keyword.

A) Dim
B) Open
C) Instantiate
D) Create
Question
Which of the following is not true about a form's Activated event?

A) It's executed when a form is initially displayed.
B) It's executed each time a form regains the focus.
C) It's executed each time the user clicks a form that does not have the focus.
D) It's executed before the Load event procedure is processed.
Question
How do you insert a separator bar into a menu?

A) Type a hyphen as a menu item object's Text property.
B) Type a space as a menu item object'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
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
Once you create a form, you do not have to re-create it to use it in another project.
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
The best method 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
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
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
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
Any form in a Windows Forms application can be designated as the startup form.
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
What is the result of the following section of code? Private Sub btnExit_ClickByVal 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
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
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 last form created for a Windows Forms application is designated as the startup form.
Question
Which of the following will display the getStudentDataForm form such that the programming statements that follow will not execute until the getStudentDataForm is closed?

A) getStudentDataForm.Open)
B) getStudentDataForm.Show)
C) getStudentDataForm.ShowDialog)
D) getStudentDataForm.OpenForm.Modal)
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
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/36
auto play flashcards
Play
simple tutorial
Full screen (f)
exit full mode
Deck 7: Multiple Forms, Modules, and Menus
1
A module-level variable declared Public is also known as a _variable.

A) private
B) access
C) global
D) universal
C
2
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
C
3
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
4
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
Unlock Deck
Unlock for access to all 36 flashcards in this deck.
Unlock Deck
k this deck
5
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 36 flashcards in this deck.
Unlock Deck
k this deck
6
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 36 flashcards in this deck.
Unlock Deck
k this deck
7
If the user should not be able to access an item that appears on a menu, set its property to __.

A) Enabled, False
B) Disabled, True
C) Active, False
D) Hidden, True
Unlock Deck
Unlock for access to all 36 flashcards in this deck.
Unlock Deck
k this deck
8
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 36 flashcards in this deck.
Unlock Deck
k this deck
9
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 used by other files in a project
C) Standard modules may contain event handlers
D) Standard modules are not associated with a particular form
Unlock Deck
Unlock for access to all 36 flashcards in this deck.
Unlock Deck
k this deck
10
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 36 flashcards in this deck.
Unlock Deck
k this deck
11
When a project 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 36 flashcards in this deck.
Unlock Deck
k this deck
12
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 36 flashcards in this deck.
Unlock Deck
k this deck
13
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 36 flashcards in this deck.
Unlock Deck
k this deck
14
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
Unlock Deck
Unlock for access to all 36 flashcards in this deck.
Unlock Deck
k this deck
15
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 36 flashcards in this deck.
Unlock Deck
k this deck
16
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 36 flashcards in this deck.
Unlock Deck
k this deck
17
It's possible to prevent a form from closing by setting __________ in the FormClosing event handler.

A) e.Close = False
B) Close.Cancel = True
C) e.Cancel = True
D) It's not possible to prevent a form from being closed.
Unlock Deck
Unlock for access to all 36 flashcards in this deck.
Unlock Deck
k this deck
18
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 36 flashcards in this deck.
Unlock Deck
k this deck
19
Which of the following is not true about a form's Activated event?

A) It's executed when a form is initially displayed.
B) It's executed each time a form regains the focus.
C) It's executed each time the user clicks a form that does not have the focus.
D) It's executed before the Load event procedure is processed.
Unlock Deck
Unlock for access to all 36 flashcards in this deck.
Unlock Deck
k this deck
20
How do you insert a separator bar into a menu?

A) Type a hyphen as a menu item object's Text property.
B) Type a space as a menu item object'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 36 flashcards in this deck.
Unlock Deck
k this deck
21
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 36 flashcards in this deck.
Unlock Deck
k this deck
22
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 36 flashcards in this deck.
Unlock Deck
k this deck
23
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 36 flashcards in this deck.
Unlock Deck
k this deck
24
The best method 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 36 flashcards in this deck.
Unlock Deck
k this deck
25
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 36 flashcards in this deck.
Unlock Deck
k this deck
26
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 36 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 36 flashcards in this deck.
Unlock Deck
k this deck
28
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 36 flashcards in this deck.
Unlock Deck
k this deck
29
Any form in a Windows Forms application can be designated as the startup form.
Unlock Deck
Unlock for access to all 36 flashcards in this deck.
Unlock Deck
k this deck
30
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 36 flashcards in this deck.
Unlock Deck
k this deck
31
What is the result of the following section of code? Private Sub btnExit_ClickByVal 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 36 flashcards in this deck.
Unlock Deck
k this deck
32
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 36 flashcards in this deck.
Unlock Deck
k this deck
33
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 36 flashcards in this deck.
Unlock Deck
k this deck
34
The last form created for a Windows Forms application is designated as the startup form.
Unlock Deck
Unlock for access to all 36 flashcards in this deck.
Unlock Deck
k this deck
35
Which of the following will display the getStudentDataForm form such that the programming statements that follow will not execute until the getStudentDataForm is closed?

A) getStudentDataForm.Open)
B) getStudentDataForm.Show)
C) getStudentDataForm.ShowDialog)
D) getStudentDataForm.OpenForm.Modal)
Unlock Deck
Unlock for access to all 36 flashcards in this deck.
Unlock Deck
k this deck
36
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 36 flashcards in this deck.
Unlock Deck
k this deck
locked card icon
Unlock Deck
Unlock for access to all 36 flashcards in this deck.