Make your own free website on


Quiz 1 - Writing Your First Program

1.  The Visual Programming step.  In this step you place objects inside
the form and set their properties.  The Code Programming step.  In this
step, you write and attach code to objects and events.

2.  The first thing you have to do is open a new project.
3.  a) Open a new project.  b) Double-click the command button icon
in the toolbox - VB responds by placing the button inside the form.
c) Open the Property window for the command button and browse through
its properties.  Repeat this process for other controls
4.  A variable is not an object
5.  a) Double-Click the object. b) Select the even by clicking the Proc
Combo box.  You may now attach code to the object by typing the code in 
between Sub and End Sub.

Quiz 2 - Properties and Controls

1.  (a)
2.  vsbVolume.Value = 37
3.  You may change the Min and Max properties of the scroll bar
    at design time and at run-time

Quiz 3 - Programming Building Blocks

1.  If B = 3 Then
       B = 2
       End If
    *You must include the "Then" word.

2.  Because the current value of the MyVariable is equal to 3, 
    the statements under Case 3 are executed.  
    Case 3
        lblMyLabel.Caption = "Good-bye"
    The lblMyLabel label contains the text "Good-bye"

Quiz 4 - The Mouse
1.  (b)

2.  The ScaleMode property degines the units of hte coordinate system
    of the object.  For example, if the ScaleMode property of a form
    is set to twips, the width, height, and all other length-related
    properties are measured in twips.

3.  (a) 

4.  The X and Y arguments contain the values of the mouse location 
    when the even occurred.

5.  (a)

6.  (b)

7.  (b) 

Quiz 5 - Menus

1.  When the Enabled property of a meny item is set to False, the menu
item is disabled (dimmed), but you can still see it.  On the other 
hand, when the Visible property of a menu item is set to False, the 
the menu item completely disappears.  You may have a need to completely
hide a menu item or a menu in some programs.

2.  A menu control array is created during design time by setting the
Index property of a meny item to 0.  This menu item becomes element
number 0 of the array.  During run-time, the program may add items
to the menyu by adding more elements to the array.  

3.  A shortcut key enables you to execute a meny item by pressing
a combination of keys on the keyboard.  You assign a shortcut key to 
menu item during design time by setting the Shortcut property of the 
menu tiem to the desired key combination (e.g. Ctrl+C, Ctrl+A, etc.)

4.  A check mark is used to mark menu items.  To place a check mark
next to a menu item during runtime, set the Checked property of the 
item to True.  To remove a check mark, set the Checked property of the
item to False.

5.  A separator bar is a horizontal line that is used to separate 
menu items.  The Caption property of a separator bar is the hyphen
character (-)


QUIZZES 6 - 10

Quiz 6 - Dialog Boxes

1.  The MsgBox statement and MsgBox() function take the same parameters
and display the same dialog boxes.  The only difference between them
is that the MsgBox() function returns a value that represents the 
button that the user selected in the dialog box.  The MsgBox state-
ment does not return any value.

2.  This statement displays a dialog box with the title ERROR, the 
message "File is missing!" and an OK button.

3.  This code displays a message box with the title DEMO, the question
message "Exit the program?" and Yes and No buttons.  If the user 
clicks the Yes button of the dialog box, the MsgBox() function returns
the value ID_YES, in which case the condition of the If statement is 
satisfied and the program terminates with the End statement

4.  This code users the InputBox() function to display a dialog box that
prompts the user to enter a name.  The returned value of the InputBox
function is assigned to the variable UserName. If the user enters a 
name and does not press the Cancel button, the variable UserName is not
null, in which case the condition of the If statement If Username <>"" 
is satisfied and the user is prompted with a Hello message that 
displays the user's name.

5.  This statement users the Show method to display the frmMyDialog
dialog box as modal.

6.  This statement uses the Hide method to hide the frmMyDialog dialog
box from view.  After executing this statement, the frmMyDialog dialog
box disappears.  Typically, this statement is used in the code of the
terminating buttons of the dialog box.  For example, after the user
responds to the dialog box by pressing the OK (or Cancel) button, use
the Hide method to hide the dialog box from view.

7.  This statement displays the Save As common dialog box.

Quiz 7 - Graphic Controls

1.  (a)

2.  In the code of the hsbWidth_Change() even procedure of the SHAPE 
program, we set the BorderWidth property of the shape control to the
current value of the scroll bar:

    shpAllShapes.BorderWidth = hsbWidth.Value

3.  When the AutoSize property is set to True, the object sizes 
itself tot he exact dimensions of the picture file.

4.  The AutoSize property is supported by a picture control and by
a label control.  When this property is set to True, Visual Basic
adjusts the size of the control so that the control fits its content.

The Stretch property is supported by an image control.  When this 
property is set to True, the size of the picture is stretched to fit
the size of the image control.

Quiz 8 - Graphics Methods

1.  Because the last point was drawn at coordinate (100,20) after the drawing
CurrentX is equal to 100, and CurrentY is equal to 20.

2.  You can't use the F option without the B option. 

3.  (c)

4.  The form on which a graphic method is drawn is automatically 
redrawn whenever there is a need to re-draw it. 

Quiz 9 - The Grid Control

1.  (a)

2.  (a)

3.  (a)

4.  (b) 

5.  Make the cell from which you want to remove the picture the current
active cell, and then use LoadPicture() with no argument.

Quiz 10 - Displaying and Printing

1.  (c) 

2.  (c)

3.  (a) 

4.  (b)

5.  The height of the characters that are specified in the argument of 
the TextHeight property.

6.  The width of the characters that are specified in the argument of 
the TextWidth property.

7. (c) 

QUIZZES 11 - 15

Quiz 11 - Interfacing with Windows

1.  The currently active control.

2.  (a)

3.  Causing an immediate refreshing of the screen.

Quiz 12 - The Keyboard

1.  Whenever the user presses an ASCII key on the keyboard

2.  Whenever the user presses any key on the keyboard

3.  Whenever the user releases a key

4.  Once the KeyPreview property of a form is set to True, the various
keyboard event procedures are executed, such as Form_KeyDown(), 
Form_KeyUp(), and FormKeyPress().

Quiz 13 - File-System Controls

1. The purpose of the first line of the code is to set an error trap
so that if a run-time error occurs on the following line, the error 
will be trapped.

2.  After the statement 
    filFiles.Pattern = "*.BAT"
is executed, the filFiles file list box displays only files that
have .BAT extension.

3.  After the statement
    filFiles.Path = dirDirectory.Path
is executed, the filFiles list box displays the files of the directory
that is currently selected in the dirDirectory directory list box.

4.  After the statement
    dirDirectory.Path = "D:"
is executed, the dirDirectory directory list box displays the directories
of the D: drive

Quiz 14 - Accessing Files

1.  The code stores the name JOHN SMITH and his age (32) in record
number 5 of the file EMPLOYEE.DAT

2.  The code displays the name of the person and his age from record
number 10.  

3.  The code creates the file TRY.TXT and writes the contents of 
txtMyText text box into the file.

4.  These statements open the file C:\TRY\TRY.TXT for sequential append.
If the file does not exist, it is created.  If it does exist, subsequen
output statements append new data to the file.

5.  The code appends the contents of the txtMyText text box to the 

6.  The code reads the contents of the file TRY.TXT into the txtMYText
text box:

7.  The code writes the string "THIS IS A TEST" into the file TRY.DAT
starting at byte location 75.

8.  The code reads 20 bytes from the file TRY.DAT, starting at byte
location 75, the code then displays these 20 bytes.

Quiz 15 - Other Topics

1.  (a)

2.  (c)

3.  No, the subscript of the array may be any value between 0 and 7.

4.  (c) 

5.  (a)

6.  (b)


QUIZZES 16 - 21

Quiz 16 - The Data Control

1.  (a) 

2.  Both (a) and (b)

3.  (a)

4.  The ReadOnly property is used to prevent your program from 
changing the contents of the field in the table from within your 
Visual Basic program.

5.  Adding a record

6.  Deleting a record

7.  Moving the record pointer to the next record.

Quiz 17 - Multiple - Document Interface (MDI)

1.  (c) 

2.  The delay is implemented as follows:

    For Counter = 0 to 10000
    Next Counter

3.  (b) 

4.  (b)

Quiz 18 - Dynamic Data Exchange (DDE)

1.  (c) 

2.  (b)

Quiz 19 - Installing your Applications

1.  (b)

2.  The VER.DL_ file is not in a compressed form.  You generate the 
VER.DL_ file by copying VER.DLL to the distribution disk as VER.DL_. 
The rest of the files that have DL_ extension were compressed using the

Quiz 20 - Dynamic Linked Libraries

1.  (a) 

Quiz 21 - Sound and Multimedia

1.  (a) 

2.  (b)

3.  sp_OpenSession()