315 ch.7

When a VB application executes, its __________ is automatically displayed.
A. Main sub
B. Startup form
C. Event procedure
D. Form load event
____ 2. When creating a form in Visual Basic, code associated with that form is stored in a file with a _____ extension.
A. sln
Proj
C. frm
D. vb
____ 3. An instance of a form is created using a __________ statement with the New keyword.
A. Dim
B. Open
C. Instantiate
D. Create
____ 4. When a __________ form is displayed, no other form in the application can receive the focus until the form is closed.
Hidden
Modeless
C. modal
Show
____ 5. 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
____ 6. 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
____ 7. 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
____ 8. Standard modules are saved on disk as files that end with this extension.
A. .mod
B. .proj
C. .frm
D. .vb
____ 9. A module-level variable declared Public is also known as a __________ variable.
A. private
B. access
C. global
D. universal
____ 10. 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.
____ 11. 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
____ 12. 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
____ 13. 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
____ 14. 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
Show
____ 15. 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.
____ 16. 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.
____ 17. 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
____ 18. 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
____ 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.
____ 20. 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.
____ 21. 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.
____ 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
____ 23. Explain the nature of the reference to errorForm in the following code:
A. Class name
B. Form name
C. Class program
D. Object variable
____ 24. When a menu control’s _________ property equals True, a check appears next to the menu item.
ShowCheck
B. Checked
C. Check
D. None of the above
____ 25. 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
____ 26. 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
27. 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
____ 28. 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()
____ 29. 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
____ 30. 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
____ 31. 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
____ 32. The last form created for a Windows Forms application is designated as the startup form.
A. True
B. False
____ 33. Any form in a Windows Forms application can be designated as the startup form.
A. True
B. False
____ 34. 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
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”
____ 36. Once you create a form, you do not have to re-create it to use it in another project.
A. True
B. False
 
{"name":"315 ch.7", "url":"https://www.quiz-maker.com/QPREVIEW","txt":"When a VB application executes, its __________ is automatically displayed., ____ 2. When creating a form in Visual Basic, code associated with that form is stored in a file with a _____ extension., ____ 3. An instance of a form is created using a __________ statement with the New keyword.","img":"https://www.quiz-maker.com/3012/images/ogquiz.png"}
Powered by: Quiz Maker