Chapter 7
How do you insert a separator bad into a menu
Type a hyphen (-) as a menu items text property
Form is stored in a file with what extension
.vb
Steps for adding module to a project
1. Click project on menu bar, click add module on the project menu. Add new item dialog box should appear 2. Change default name that's displayed in the name text box to the name you wish to give the new standard module 3. Click add button
context menu
A menu that displays when you right-click the screen, displaying commands that relate to your current task.
Module level variable
Accessible to any procedure or function within that module (variable is declared using dim and outside all procedures and functions)
A form's ____ event is triggered when the user switched to the form from another form or application
Activated
The MenuStrip Control
Adds a menu bar to your form Displayed in the component tray (bottom of design window)
show() method
Causes the form to display in a modeless form - allows user to switch focus between the forms while a form is opened
Checked menu items
CheckOnClick property to true to turn on Then set Checked property to true if feature should be on when form is initially displayed
How to create a module
Click project in menu bar then click add module
How to add a new form
Click project- select add windows form - add new item
Close method
Closes a form and removes its visual part from memory Keyword- me - refers to form
ShortcutKeys property
Combo of keys that cause a menu command to execute Ex. Ctrl + C to copy Has to be set to true You don't have to open the menu to use
Module
Contains only code, no graphics Can be accessed by all forms No event handlers Stores in files that end with .vb extensions
Class-level variable in a form
Declared by the rim statement outside all the procedures and functions
How do you set up a load event?
Double click on the black area of the start up form
FormClosed Event
Occurs after form has closed You can not prevent a form from closing with form closed every
The ________ event occurs when a form is in the process of closing, but before its closed
FormClosing
Submenus
If menu has submenu, a solid right pointing arrow will be shown
Activated event
Occurs when the user switches to a form from another form or application
If keyword public is used to declare variable
It's accessibly to all procedures and functions within the protect (include all classes)
Global Variable
Keyword: public in place of Dim and declare outside all procedures and functions A global variable is used by any procedure / function in ALL classes
Just before a form is initially displayed, this event occurs.
Load
Hide() method
Makes a form or control invisible but does not remove it from memory Me.Hide()
Disabled Menu Items
Menu item is grated out with the enabled property For example: enabled property is true by default, paste open room is initially disabled and only enabled after something is cut or copied
In order to add a menu to a form, you must place a ________ on the form.
MenuStrip control
Show method displays a form in
Modeless style
If a procedure or variable is used by more than one form, where should it be declared?
Module
Frm
Prefix used to indicate that the variable references a form
If you want to declare g_intTotal in a module as a global variable, which declaration would you use?
Public g_intTotal as integer
Delete option
Remove a form from a project and physically delete its file from the storage
Exclude from project option
Remove a form from a project but leave its files on disk
How do you make a menu item disabled?
Setting it's enabled property to false
What property must be set on a menu item to have the user activate that option by pressing ctrl + c on keyboard?
ShortcutKeys
All of the following are true about standard modules EXCEPT
Standard modules may contain event handlers
FormClosing event
Triggered as the form is being closed but before it's actually closed -can be used to ask the user if they really want to close form
Load event
Triggered just before the start up form is displayed Codes inside the load event is execute only once before the display of the startup form firing program execution
Any form in a Windows Forms application can be designated as the startup form.
True
Solution Explorer Window
Use this to change the file name
Keyword: new
Used to create an instance
Once you create a form
You don't have to recreate it to use it in another prject
menu system
a collection of commands organized in one or more drop-down menus
A variable is accessible to statements outside the form if declared __________.
as public and class-level
An instance of a form is created using a __________ statement with the New keyword.
dim
ShowDialog method
displays a modal form and causes it to receive the focus
Statement will display the getStudentDataForm in such a way that any code following the statement will not execute until the getStudentDataForm closes
getStudentDataForm.ShowDialog()
A module-level variable declared Public is also known as a _______ variable.
global
context menu
is shown when the user right-clicks a form or control
If an applications menu system has a cut command on the edit menu, what should the menuitem control for the command be named ?
mnuEditCut
When a ________ form is displayed, no other form in the application can receive the focus until the form is closed
modal
When this type of form is displayed, statements following the method call continue to execute after the form is displayed.
modeless
Startup form
the first form that is displayed in an application