CSC Chapter 7

Réussis tes devoirs et examens dès maintenant avec Quizwiz!

Standard modules are saved on disk as files that end with this extension.

.vb

Describe the process of adding a new form to a project.

1. Click PROJECT on the menu bar, and then click Add Windows Form... on the PROJECT menu. The Add New Item dialog box should appear. 2. Change the default file name that is displayed in the Name text box to the file name you wish to give the new form. 3. Click the Open button.

Describe the process of changing the startup form to another form.

1. In the Solution Explorer window, right-click the project's entry. 2. On the popup menu, click Properties. 3. Make sure the Applications tab is selected at the left edge of the Properties page. Click the down arrow in the Startup Form drop-down list. A list of all the forms in the project appears. Select the form you want to designate as the startup form. 4. Save the project and close the project's properties page.

Describe the process of removing a form from a project, but not deleting the form file.

1. Right-click the form's entry in the Solution Explorer window. 2. On the pop-up menu, click Exclude From Project.

Describe the process of removing a form from a project and deleting the form file.

1. Right-click the form's entry in the Solution Explorer window. 2. On the pop-up menu, click Delete.

What is the difference between a menu control's access key and its shortcut key?

A MenuStrip control's access key only works while menu is open, while a shortcut key may be executed at any time while the form is active.

What is a disabled menu item? How do you make a menu item disabled?

A disabled menu item appears dimmed, or "grayed out," and may not be selected by the user. You may disable a menu item by setting its Enabled property to False.

A form's ________ event is triggered when the user switches to the form from another form or another application.

Activated

This event occurs when the user switches to the form from another form or another application.

Activated

A context menu displays when the user double-clicks a control.

False

A menu command's shortcut key works only while the menu is open.

False

If you have code that you want to execute every time a form displays, the form's Load event procedure is the best place to write it.

False

T F: A context menu displays when the user double-clicks a control.

False

T F: A menu command's shortcut key works only while the menu is open.

False

T F: If you have code that you want to execute every time a form displays, the form's Load event procedure is the best place to write it.

False

T F: It is not possible to access a control on another form in code.

False

T F: The Activated event executes only once—when the form is initially displayed.

False

The Activated event executes only once—when the form is initially displayed.

False

The last form created for a Windows Forms application is designated as the startup form.

False

The ________ event occurs when a form is in the process of closing, but before it has closed.

FormClosing

This event occurs as a form is in the process of closing, but before it has closed.

FormClosing

A module-level variable declared Public is also known as a(n)________variable

Global

The_____method removes a form from the screen but does not remove it from memory.

Hide

This method makes a form invisible, but does not remove it from memeory.

Hide

A form uses this statement to call its own Close method.

Me.Close()

In order to add a menu to a form, you must place a ________ on the form.

MenuStrip control

When a ________ form is displayed, no other form in the application can receive the focus until the form is closed.

Modal

When a(n)______form is displayed, no other form in the application can receive the focus until the form is closed.

Modal

If a procedure or variable is used by more than one form, where should it be declared?

Module

if a procedure or variable is used by more than one form, where should it be declared?

Module

A(n)_____ is a variable that holds the memory address of an object and allows you to work with the object.

Object variable

When a procedure declaration in a form file begins with___________, the procedure may only be accessed by statements in the same form

Private

To make a class-level variable available to statements outside the module, you declare it with the__________keyword.

Public

If you want to declare g_intTotal in a module as a global variable, which of the following declaration would you use?

Public g_intTotal As Integer

If you want to declare g_intTotal in a module as a global variable, which of the following declarations would you use?

Public g_intTotal As Integer

What does the Hide method do?

Removes a form from the screen but does not remove it from memory

What does the statement Me.Close() do?

Removes the currently active form from the screen and removes it from memory.

What property must be set on a menu item to have the user activate that option by pressing Ctrl + C on the keyboard?

ShortcutKeys

The_____method displays a form in modal style.

ShowDialog

What is the difference between the Load event and the Activated event?

The Load event is triggered when a form is initially displayed. The Activated event is triggered when the user switches to the form from another form or another application. The Activated event is also triggered when a form is initially displayed, after the Load event is triggered.

Suppose you want to execute code when a form has fully closed. Where should you place the code?

The form's FormClosed event handler

Suppose you want to execute code when a form is about to close, but has not fully closed. Where should you place the code?

The form's FormClosing event handler

Describe the steps for adding a module to a project.

To add a module, do the following: 1. Click PROJECT on the menu bar, and then click Add Module on the PROJECT menu. The Add New Item dialog box should appear. 2. Change the default name that is displayed in the Name text box to the name you wish to give the new standard module. 3. Click the Add button.

Although the Hide method removes a form from the screen, it does not remove it from memory.

True

Any form in a Windows Forms application can be designated as the startup form.

True

Once you create a form, you do not have to re-create it to use it in another project.

True

T F: Although the Hide method removes a form from the screen, it does not remove it from memory.

True

T F: By default, the first form you create is the startup form.

True

T F: If a menu control does not display a menu or submenu, you make it functional by providing a Click event handler for it.

True

T F: The FormClosing event executes before a form has completely closed.

True

T F: The Show method displays a form in modeless style.

True

The FormClosing event executes before a form has completely closed.

True

How do you insert a separator bar into a menu?

Type a hyphen (-) as a menu item's Text property.

How do you make a menu item disabled?

by setting its Enabled property to False

When this type of form is displayed, statements following the method call continue to execute after the form is displayed.

modeless

All of the following are true about standard modules except ________.

Standard modules may contain event handlers

If a form is the , it is displayed first when the project executes.

Startup object

When a menu item's__________property equals True, a check mark appears on the menu next to the item's text.

Checked

The_______method removes a form from the screen and releases the memory it is using

Close

This method makes a form invisible, but does not remove it from memory.

Close

A(n)________is a pop-up menu that is displayed when the user right-clicks a form or control

Context menu

An instance of a form is created using a ________ statement with the New keyword.

Dim

You can disable a menu control in code by setting its___________property to False.

Enabled

Modules contain no________procedures.

Event

This event occurs after a form has closed.

FormClosed

How do you create a checked menu item?

In the Properties window set the menu item's CheckOnClick property to True.

Just before a form is initially displayed, this event occurs.

Load

The______method displays a form in modeless style.

Show

Suppose you wish to declare a variable in a module so all the forms in the project have access to it. How should you declare the variable?

With the Public key word, such as Public intValue As Integer.

In code, how do you determine whether a check mark appears next to a menu item?

You test its Checked property. If the Checked property is true, a check mark appears next to the Item. Otherwise, the item is unchecked.

A menu command's________only works while the menu is open, while a(n)_________may be executed at any time while the form is active.

access key, shortcut key

A variable is accessible to statements outside the form if declared ________.

as public and class-level

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?

etStudentDataForm.ShowDialog()

Which of the following variable name prefixes do we use in this book for variables that reference forms?

frm

A module-level variable declared Public is also known as a ________ variable.

global

A context menu ________.

is shown when the user right-clicks a form or control

If an application's menu system has a Cut command on the Edit menu, what should the MenuItem control for the command be named?

mnuEditCut

Which of the following statements disables the mnuFilePrint object?

mnuFilePrint.Enabled = False

When this type of form is displayed, no other form in the application can receive the focus until the form is closed.

modal

When creating a form in Visual Basic, code associated with that form is stored in a file with a ________ extension.

vb


Ensembles d'études connexes

Urinary Catheterization: 210L Quiz #11

View Set

OB/PEDS Final Questions from Study Guide

View Set

CHAPTER 19 documenting / Reporting

View Set