CIS 230 - Visual Basic

Ch. 5 Worksheet #1 Answers

1. What is the prefix for a menu control?

mnu

2. What event would trigger if the user selected the menu command "Print" under the "File" menu.

mnuFilePrint_Click

3. Even though menu separator bars do not have Click events, a programmer must name each one that is used in a menu. What does the textbook author recommend as the name of your first spearator bar in a menu?

mnuSep1

4. What symbol is used in the common Windows interface to indicate that a menu command can be toggled on and off?

check mark

5. What is the difference between keyboard access keys and keyboard shortcuts?

access keys - Alt + [key]; used on objects within view on the form such as command buttons
keyboard shortcuts - Ctrl + [key]; used on menus; for example, Ctrl + p to print

6. List a few Windows standards that you have noticed with regard to the way menus are used in commercial software. (Example: Print is a command under the File menu.)

File goes on the left end of menu bars
Exit goes at the bottom of a File menu
Help goes to the far right of menu bars

7. What is the the VB prefix that should be used with the Common Dialog control?

dlg

8. What does it mean to pass a value to a procedure?

When a variable is listed within a call statement in a calling procedure and also listed within the parentheses that follow the called procedure, its value is used within the calling procedure. In this way, it is possible to use a variable's value in the called procedure even though the passed variable is a local variable to the calling procedure.

9. Which is the default method of passing arguments, ByVal or ByRef?

ByRef

10. Describe a situation in which a function procedure would be more appropriate than a sub procedure.

When you need the procedure to return a single value to the point where it was called