Visual Basic in 12 Easy Lessons velans.htm

Previous Page TOC



Answers



Lesson 1, Unit 1


  1. A program is a list of instructions that tells the computer exactly what to do.
  2. Absolutely nothing. A computer is a dumb machine that cannot function without the detailed instructions of a program.
  3. You can buy a program or write one yourself.
  4. The programs that you write do exactly what you want them to do once you get any bugs out of them.
  5. Writing your own programs takes lots of time and effort.
  6. True
  7. Code is a program.
  8. An error that you accidentally place in the programs that you write.
  9. There are syntax errors and logic errors.
  10. You've just put a syntax error in the program.
  11. Visual Basic finds syntax errors for you.
  12. Logic errors are much harder to find than syntax errors.
  13. With hardwired control panels.
  14. Non-electrical people could program computers.
  15. On and off states of electricity.
  16. The addition of the computer keyboard introduced programming to the masses.
  17. Code is the program that you and other programmers create.
  18. Machine language
  19. FORTRAN
  20. BASIC
  21. Beginner's All-purpose Symbolic Instruction Code
  22. Procedural programming languages lend themselves well to text-based DOS environments.
  23. Event-driven programs lend themselves well to Windows-like environments.
  24. Graphical User Interface
  25. Two events might be a keypress or a mouse click.
  26. The user might trigger any event in any order.
  27. False. Visual Basic does require some procedural-like programming for certain functions.
  28. True

Lesson 1, Unit 2


  1. True
  2. True
  3. Add a shortcut Ctrl + Shift + V keystroke using the File Properties menu after highlighting the Visual Basic icon in the program group.
  4. False
  5. Select File Run, then type A:\SETUP (You can type the command in uppercase or lowercase letters).
  6. The value used if you don't type a different value.
  7. VBPRIMER
  8. Select File Exit to exit Visual Basic and return to Windows.
  9. You may lose some or all of the program you're writing.
  10. The Code window, Form window, Project window, Properties window, and the Toolbox window.
  11. Visual Basic uses the Form window for the application's background.
  12. False
  13. True. Click on the dialog control box's upper-left corner.
  14. Use the access keys to more quickly execute menu commands.
  15. The toolbar provides push button access to common menu commands.
  16. The Visual Basic menu bar follows the same naming standard for most of its menu commands as other major Windows programs use.
  17. Eleven
  18. Not all menu or toolbar commands are available at all times.
  19. The measurement indicators describe the size and location of elements on the Form window.
  20. A twip is 1/1440th of an inch.
  21. The grid provides snap-to locations that keep controls in alignment with the grid's dots when you set the appropriate Options Environment command.

Lesson 2, Unit 3


  1. You must first load the application using File Open.
  2. The project file holds the application's description.
  3. .MAK
  4. Load the project and look in the Project window.
  5. To let the user interact with and direct the program. Users click, scroll, and manage the controls as a way to respond to a program's activities.
  6. The Toolbox window holds the controls that you can add to your form. (Don't you think "Control window" would be a better name?)
  7. The user needs an easy way to exit a program.
  8. False. The user cannot directly change text displayed in a label control.
  9. The text box control.
  10. You can control the font size and style of the text.
  11. The user can move the text cursor forward and backward in a text box as well as use the Ins and Del keys to insert and delete text.
  12. The command button control
  13. False
  14. True
  15. The user deselects a check box by selecting the box a second time.
  16. The frame control
  17. True
  18. True
  19. False
  20. True
  21. The form works as the application's background and holds the controls that you place there.
  22. True
  23. The user can click the command button with the mouse or press the Alt+ shortcut access keystroke if the command button's label contains an underlined character. There is a third way as well (not documented in this unit): The user can press Tab until the command button is highlighted and press Enter.
  24. The command button next to the combo box informs Visual Basic that there is data to be added to the list.
  25. Pamela should replace the simple combo box with a dropdown combo box control.

Lesson 2, Unit 4


  1. An event might be a user keypress, mouse movement, mouse click, menu selection, or virtually anything else that a user can do to respond to a program.
  2. There are too many ways for the user to interact with the visual controls on the screen. A text-based program dictates the order of the user's involvement.
  3. False. Sometimes Windows captures events for its own system use.
  4. Properties are attributes that differentiate the actions and behaviors of controls.
  5. Event procedures
  6. Here are four properties (from a huge list of many others): font size, font style, the control size, and the control color
  7. True
  8. True
  9. The Properties window
  10. The process of updating the program later.
  11. The three-letter prefix describes what kind of control you're working with.
  12. Users will more speedily adapt to your programs when they follow Windows standards.
  13. AUTOLOAD.MAK
  14. CONSTANT.TXT
  15. Names given to data values that make them easier to remember.
  16. False
  17. Double-click the control on the Form window.
  18. The first part of the event procedure is the control name, followed by an underscore, followed by the name of the event (and parentheses come after that to let you know you're working with a procedure name and not a control name).
  19. Wrapper code
  20. End
  21. The controls and form names inside the project.
  22. Usually the project and form names are the same with a .MAK and a .FRM extension respectively.
  23. A form
  24. A combo box
  25. A command button
  26. Victor, less is better! Use fewer fonts or you'll confuse the user looking at your screen.
  27. A. End is a reserved word.
    B. Names cannot begin with a number.
    C. Names cannot contain special characters such as a dollar sign.
    D. Names cannot contain hyphens.

Lesson 3, Unit 5


  1. The control that has Window’s current attention. You can tell which one it is by the highlighting.
  2. The order in which the controls receive the focus as the user presses the Tab key.
  3. TabIndex
  4. The Name property.
  5. False
  6. True
  7. CONSTANT.TXT
  8. An icon is a picture.
  9. A point is 1/72nd of an inch.
  10. A selection of colors from which you can choose.
  11. D. All of the above.
  12. Enabled.
  13. 0, 1, or 2 representing left-justified, centered, or right-justified.
  14. False; rarely will you have to set or change more than a few properties because the default values are so common for many of the properties.
  15. A carriage return character sends the text cursor to the next line on the screen.
  16. Dynamic Data Exchange.
  17. True due to the Visible property.
  18. Left, Right, Top, Width.
  19. The label control.
  20. The PasswordChar property.
  21. The Cancel property.
  22. Use the control dropdown selection box.

Lesson 3, Unit 6


  1. Yes, the form is an object as is the other controls.
  2. False, label controls have no MultiLine property.
  3. A pixel is the smallest screen element available.
  4. The WindowState property.
  5. Chopping off part of text.
  6. False
  7. False, text box controls can have scroll bars.
  8. Set the AutoSize property to False.
  9. False.
  10. False.
  11. The TabIndex property controls the focus order.
  12. The Load event.
  13. The Load event occurs before the Activate event occurs.
  14. The Code window contains a Proc dropdown list box that contains all the events for any given object.
  15. Labels can never receive the focus.
  16. The name of the event procedure must be txtLastName_Change().
  17. The KeyPreview property determines whether the form or control gets the keystrokes.
  18. The Caption property.
  19. Add the access key to a label that describes the text box contents. Make sure that the TabIndex of the label is sequentially one less than the TabIndex of the text box.
  20. The labels could hide too many other form objects.
  21. The label would automatically expand horizontally before you have a chance to set the WordWrap property.

Lesson 4, Unit 7


  1. A named storage location in memory.
  2. The Dim statement.
  3. A data type is a category of data that all Visual Basic values fall into.
  4. Integer, Long, Single, Double, Currency, Variant, String
  5. Integer
  6. Double
  7. Single, Double, and Currency
  8. E means Exponent.
  9. Scientific notation provides a shortcut notation for a wide range of numeric values.
  10. False
  11. True; variables can change but they do not have to.
  12. You'll help eliminate bugs that can occur when you misspell a variable name.
  13. A fixed-length string can only accept a preset number of characters while variable-length strings can accept strings of changing-length as a program runs.
  14. True
  15. True
  16. A. 7
    B. 9
    C. 16
    D. (parentheses would be required around the addition to compute a true average)
    E. 6
    F. 40
  17. Merge the strings together
  18. + is used for either addition or string concatenation (depending on the context of its use) and & is used strictly for concatenation.
  19. Dim SqFoot As Single
  20. SalesPrice = Price / Discount
    Tax = TaxRate * SalesPrice
  21. Name is a reserved word and cannot be a variable name.
  22. Judy cannot define more than one variable with the same name. There is an advanced exception to this rule that you'll learn in Lesson 7.
  23. Larry cannot use a dollar sign or commas in constant values.

Lesson 4, Unit 8


  1. A condition is a relation that you can check for in your program.
  2. False, conditional tests produce one of two results, true and false
  3. False but the parentheses help clarify the code
  4. <, >, <=, >=, =, <>
  5. A. False
    B. True
    C. True
    D. True
    E. True
    F. False
  6. The ASCII table
  7. The If statement makes decisions (as well as the Select Case)
  8. The If-Else statement
  9. False
  10. A nested If is an If statement within another If statement
  11. The Select Case
  12. Four: Case value, Case Is, Case To, and Case Else
  13. Nothing happens and control falls to the statement following the End Select statement
  14. The code in the Case Else executes before control returns to the statement following the End Select statement
  15. Case To
  16. Case Is
  17. If (M = 3) AND (P = 4) Then
    TestIt = "Yes"
    End If
  18. If (d >= 3) Or (p < 9) Then
  19. Select Case Age
    Case Is <0: lblTitle.Text = "Age Error"
    Case Is <5: lblTitle.Text = "Too young"
    Case 5: lblTitle.Text = "Kindergarten"
    Case 6 To 11: lblTitle.Text = "Elementary"
    lblSchool.Text = "Lincoln"
    Case 12 To 15: lblTitle.Text = "Intermediate"
    lblSchool.Text = "Washington"
    Case 16 To 18: lblTitle.Text = "High School"
    lblSchool.Text = "Betsy Ross"
    Case Else: lblTitle.Text = "College"
    lblSchool.Text = "University"
    End Select
  20. There is no End Else statement.

Lesson 5, Unit 9


  1. A comment that helps explain a program's logic.
  2. To help aid programmers with program maintenance.
  3. False
  4. True
  5. Two: The Rem statement and the apostrophe remark
  6. To state the programmer's name and the date the program was written
    To describe in the (general) procedure the overall goal of the program
    To describe at the top of all procedures the overall goal of that procedure
    To explain tricky or difficult statements so that others who modify the program later can understand the lines of code without having to decipher cryptic code
  7. Programmers
  8. False; add remarks when you write your program so you'll be able to understand the program more easily when you modify it later.
  9. False
  10. Specify a type value that signifies which group of command buttons you need.
  11. By specifying a msg value.
  12. Modal indicates whether or not the user must respond to a message box before switching to another application.
  13. True
  14. False
  15. To get answers
  16. Strings and variants
  17. Check for a null string, "", to see if the user pressed Cancel or OK.
  18. Press the OK command button (or press Enter which clicks the OK command button)
  19. Four
  20. None
  21. Use a proper type value
  22. Seven
  23. Seven
  24. Make sure that the type argument includes the value of 4096 or the MB_SYSTEMMODAL named constant.
  25. Bob can use the only the apostrophe if he wants to include a remark at the end of a line. Bob must change the code to this:
  26. do until (endOfFile) ' Continue until the end

Lesson 5, Unit 10


  1. A loop is the repetition of a block of Visual Basic statements.
  2. Five
  3. Four
  4. True
  5. A loop that repeats forever (at least until the user intervenes to stop the loop)
  6. Keep asking the user for the answer, using a loop, until the user enters a correct response.
  7. 9
  8. 10
  9. 0
  10. 10
  11. 1
  12. The For statement
  13. The Do statement
  14. The Do While loop continues executing while a relational test is true, whereas the Do Until loop continues executing while a relational test is false.
  15. Visual Basic checks the relational test at the top of the loop using a Do While statement, whereas, Visual Basic checks the relational test at the bottom of the loop using a Do-Loop While statement.
  16. An iteration is one complete loop cycle.
  17. Use a negative Step value.
  18. The increment's Step value must be negative.
  19. The Exit Do and the Exit For statements end loops before their natural termination.
  20. Dim Guess, Ans As Integer
    Guess = 34 ' The user must guess this
    Do
    Ans = InputBox("Make a guess...", "Guessing Game")
    ' Tell the user about the wrong guess
    If (Ans <> Guess) Then
    MsgBox "You guessed incorrectly. Try again."
    End If
    Loop While Ans <> Guess
  21. Larry changes the variable named i inside the loop, keeping the For loop's controlling variable from ever triggering the end of the loop.
  22. Kim must switch the starting and ending values like this:
    For I = 1 To 100 Step 1

Lesson 6, Unit 11


  1. Arrays let you step through large amounts of data without the need to reference multiple variable names.
  2. A single item from the array's list of values
  3. The array subscript is the number that references different array elements.
  4. One
  5. 20
  6. True
  7. Use the subscript
  8. The Static statement defines arrays
  9. 1
  10. The For loop works best for array processing.
  11. List and combo boxes
  12. False
  13. True as long as the MultiSelect property is set to True.
  14. True
  15. The methods initialize, count, and remove items from list and combo box controls.
  16. The AddItem method
  17. True
  18. False
  19. True
  20. True
  21. The Selected method
  22. False
  23. The Sorted property
  24. Static StdAges(3) As Integer
  25. The MultiSelect property
  26. Sub cmdGoAway_Click()
    lstVals.Clear
    End Sub
  27. The command button can trigger an event procedure that uses the AddItem method to add the new item to the combo box.
  28. Carla cannot define a list box as if the list box were a variable array. Carla must use the list box control on the Toolbox window to place a list box on the form.

Lesson 6, Unit 12


  1. The option button
  2. The check box
  3. Option buttons imitate older radios with push button station selectors.
  4. The first option button will no longer be selected.
  5. True
  6. The Alignment property determines if the option or check box description appears to the right or left of the button or check box.
  7. The Value property
  8. The Value property
  9. False
  10. True
  11. A holder of other controls such as option buttons.
  12. False
  13. A special character that performs an action on the screen.
  14. Concatenate a combination of carriage-return/line feed character strings within text to break the lines onto separate label lines.
  15. Changes a number to its ASCII character equivalent.
  16. An array of controls that are the same control type.
  17. All arrays, including control arrays, have only one name.
  18. By a subscript
  19. Zero
  20. One
  21. Index
  22. By displaying a message box that makes sure you want to create a control array.
  23. cmdAll_DblClick (Index As Integer)
  24. Opal needs to draw her application's option buttons within their frames, not move them into the frames.

Lesson 7, Unit 13


  1. An argument is a value that you pass to a function inside the function's parentheses.
  2. False
  3. True
  4. False
  5. There are three different integer functions because there are different ways to round numbers.
  6. A. 61
    B. -62
    C. -61
    D. 422
  7. False; CInt() is a true rounding function whereas Int() and Fix() always round positive arguments down to the integer equal to or lower than the argument.
  8. The Asc() function is the mirror-image function to Chr$().
  9. A. "ABCDEFG"
    B. "abcdefg"
  10. Anything would hold the string "78.1"
  11. A. S
    B. Sam
    C.
    D. ams
    E. ams
  12. True, see question #18 and #19.
  13. True
  14. Str$() (or Str())
  15. Pass the numeric value to Str$() before concatenating the value to the prompting string.
  16. Send to Len() a double-precision variable and multiply the result by 250.
  17. Dim ANum, ANumSq As Single
    ANum = Val(InputBox$("Enter a number to square"))
    MsgBox "The square of your number is" & Str$(Sqr(ANum))
  18. First = InputBox$("What is your first name?")
    Last = InputBox$("What is your last name?")
    MsgBox "Your name has" & Str$(Len(First) + Len(Last)) & "letters"
  19. ValAsc = Asc("P")
  20. Rudy needs to convert the weight value to a long integer because he is computing a value too large for an integer result.

Lesson 7, Unit 14


  1. True
  2. The time and date functions get their values from your computer's internal clock and calendar.
  3. 24-hour times do not use the AM or PM designators. Add 12 to all times after 12:59 PM to get the 24-hour time.
  4. True
  5. False
  6. 19:54
  7. Date$() returns a string and Date() returns a variant data type.
  8. False; Visual Basic supports only a Now() function.
  9. Now() returns a value based on the 12-hour clock.
  10. False
  11. False; Date and Time (statements not functions) set your computer's date and time.
  12. Date$()
  13. Timer() returns the number of seconds since midnight as a double-precision value.
  14. A byte is a character of memory.
  15. The VarType 7 data type
  16. TimeValue() accepts three argument values, the hour, minute, and second, and forms a time whereas Hour(), Minute(), and Second() all accept a full time value and return individual pieces of the time.
  17. A logical value is the result of a relational comparison.
  18. Format() and Format$()
  19. Format() returns a variant data type and Format$() returns a string.
  20. A thousands separator is a comma (or period for some international settings) that separates every three digits to the left of the decimal point in values more than 999.
  21. The "Fixed" fixed-format string does not enclose negative values in parentheses and does not display a thousands separator in large numbers.
  22. Time$ will not accept 12-hour values that contain the AM or PM designator. You can use the Right$() function to see if the user happened to enter AM or PM.

Lesson 8, Unit 15


  1. Technically, the answer is false. We're splitting hairs, however. An event procedure is a specialized form of a subroutine procedure.
  2. Use the Call statement to call subroutine procedures.
  3. Use the function procedure's name inside an expression or statement.
  4. You can select from the View menu bar command or type Sub or Function below another procedure in the Code window.
  5. If a dollar sign appears after the function name, the function returns a string.
  6. A function procedure returns a value back to the calling procedure.
  7. Assign the function's return value to the function name as if the function name were a variable.
  8. F2
  9. The programmer must supply the code for function procedures.
  10. Module
  11. .BAS
  12. You do not yet know how to pass data between procedures.
  13. Option Base and Option Explicit
  14. True
  15. True
  16. Sub PrReport()

    End
  17. Function GetValue()

    End Function
  18. GetPi = 3.14159
  19. There are no parentheses around the argument list so you cannot use the Call keyword.

Lesson 8, Unit 16


  1. Local
  2. Module
  3. Global
  4. False
  5. True
  6. True
  7. Global
  8. Module
  9. As global constants
  10. Defined global named constants
  11. Nowhere else in the program are you allowed to assign values to constants.
  12. In the (general) procedure of a non-form module.
  13. True; one can be local to one procedure and one local to another. You can also have a local variable that has the same name as a global variable. The local variable will be the active variable inside its procedure.
  14. The values in local variables go away when the procedure ends.
  15. The sending procedure
  16. The receiving procedure
  17. False
  18. The variables that you pass are local to the calling function so the receiving function needs to know the data types of the arguments received.
  19. False
  20. False; you can pass several arguments to a function procedure but return only one value.
  21. Two
  22. Passed data may be changed by the receiving procedure and those changes remain in effect when the sending procedure regains control.
  23. Passed data cannot be changed by the receiving procedure except within the boundaries of the receiving procedure.
  24. Use the ByVal keyword or enclose passed arguments in parentheses.
  25. The UBound() function
  26. Global LastName As String
    Global Age As Integer
  27. Global Const NDAYS = 7
    Global Const NMONTHS = 12
  28. A. You must initialize a constant and constants cannot have data type declarations.
    B. Constants cannot have data type declarations.
    C. Always define constants using the Const keyword.
    D. You cannot initialize a global variable at the time that you define the variable.
  29. Merle should never code the subscript value inside a receiving array's parentheses. Leave the parentheses blank and use the UBoumd() function inside the procedure to find the highest subscript in the array.

Lesson 9, Unit 17


  1. File data
  2. The user can select from drives, paths, and filenames when you use a dialog box. The user can too easily make mistakes when entering a filename in response to an input box.
  3. A set of controls that get user information.
  4. Add a frame to the form that holds the file controls. The frame lets you group the file controls together without interfering with other controls such as other list boxes.
  5. Set the frame's Visible property to True or False.
  6. Three
  7. At runtime
  8. A pattern, using the * and ? filename wildcard characters, that determine which files are to be displayed in the file list box.
  9. When one file control changes, that change usually affects other file controls.
  10. Manage the drive list box first because more is affected by the drive list box change than by changes made to the other file controls.
  11. The directory and the filename list box controls.
  12. The filename list box control is the only control that needs to be updated when the user changes the directory list box.
  13. The DidCancel variable contains either True or False.
  14. The Change event.
  15. True
  16. Both ACCT* and ACCT*.* work.
  17. Both *.ex? and *.ex* work.
  18. drvDisk.Drive = "d:"
    dirList.Path = "d:\vbprimer\direng" ' Root directory

Lesson 9, Unit 18


  1. A collection of related data, programs, or a document.
  2. To hold long-term data.
  3. True as long as the files reside in separate directories or disks.
  4. Open
  5. Input, Output, and Append
  6. the file number associates a file with a number.
  7. Visual Basic creates the file.
  8. Visual Basic overwrites the file.
  9. Visual Basic creates the file.
  10. Visual Basic adds to the end of the file.
  11. Visual Basic displays an error.
  12. 1 to 255
  13. False
  14. FILES=
  15. FreeFile()
  16. Close
  17. Close ensures that the file is safely stored away in case a power failure occurs.
  18. The statement closes all open files.
  19. Write#
  20. A comma
  21. A pound sign
  22. A quotation mark
  23. Input#
  24. A line from a file
  25. The Eof() function tests for the end of file.
  26. Line Input#
  27. "Peach", 34.54, 1, "98"
  28. Rusty must use the following Line Input# command:
    Line Input #1, MyRecord
  29. Close 3, 19
  30. Open "names.dat" for Append As #7
  31. Sub ReadData ()
    ' Reads array data from a file and reports the data
    ' Assume that 200 values were read
    Static CNames(200) As String, CBalc(200) As Currency
    Static CDate(200) As Variant, CRegion(200) As Integer
    Dim NumVals As Integer ' Count of records
    Dim ctr As Integer ' For loop control

    NumVals = 1 ' Start the count
    ' Reads the file records assuming
    ' four values on each line
    Open "c:\mktg.dat" For Input As #1
    Input #1, CNames(NumVals), CBalc(NumVals), CDate(NumVals), CRegion(NumVals)
    Do Until (Eof(1) = True)
    NumVals = NumVals + 1 ' Increment counter
    If (NumVals = 201) Then
    MsgBox "First 200 values are now read", MB_ICONEXCLAMATION
    Exit Do
    End If
    Input #1, CNames(NumVals), CBalc(NumVals), CDate(NumVals), CRegion(NumVals)
    Loop

    ' When loop ends, NumVals holds one too many
    NumVals = NumVals - 1

    ' The following loop is for reporting the data
    For ctr = 1 To NumVals
    ' Code goes here that outputs the array
    ' data to the printer
    '
    Next ctr
    Close #1

    End Sub

Lesson 10, Unit 19


  1. The Menu Design window designs menus.
  2. True
  3. False
  4. True
  5. mnu
  6. A pull-down menu that appears when you click a menu bar item.
  7. The up and down arrow command buttons let you rearrange menu options.
  8. The left and right arrow command buttons let you indent or remove indentions that indicate submenu items.
  9. Checked
  10. Visible
  11. True
  12. A single hyphen
  13. Click
  14. Chr$(8) (the backspace character) right-justifies menu bar items.
  15. True
  16. Frank needs to concatenate the Chr$(8) at runtime in the Form_Load() procedure.
  17. mnuWindowSplit
  18. mnuViewBar1 and mnuViewBar2
  19. Select the Enabled property to gray out certain menu items.

Lesson 10, Unit 20


  1. The Timer control
  2. The Interval property
  3. The user does not see the timer control on the running program's form.
  4. Nothing.
  5. False; the timer control triggers its own events.
  6. Milliseconds
  7. False
  8. One thousandth of a second
  9. Ten seconds
  10. One minute
  11. tmr
  12. The Interval property can hold values larger than integers can hold.
  13. Timer()
  14. False; you can only trigger a timer event to occur repeatedly
  15. The Windows environment can sometimes cause a Visual Basic application to skip a time interval
  16. Add a timer control to the project with an Interval property value of 1000 so the timer event occurs every second. Update the time display inside the timer control's Timer() event procedure.

Lesson 10, Unit 21


  1. Print
  2. The Windows Print Manager collects all printing and routes the output to the appropriate printer.
  3. The Windows Print Manager recognizes all installed printers so that individual programs do not have to.
  4. Online means that the printer is ready and has paper.
  5. Issue a message box that warns the user of subsequent output.
  6. The Printer object is a generic Visual Basic object that collects all printed output and sends that output to the Windows Print Manager.
  7. True
  8. The smallest point on a printer or screen.
  9. The Print method
  10. False
  11. False
  12. The positive numbers each contain a hidden plus sign that does not print.
  13. A zone is a kind of built-in tab stop that occurs every 14 columns of printed output.
  14. True
  15. Use Chr$(34)
  16. True
  17. The distance between the bottoms of the characters on one line to the bottoms of the characters on the line above.
  18. Caroline is not taking into account the fact that Windows printers support different fonts and font sizes that may require calculation to find appropriate page lengths.
  19. The second Print slips 10 spaces before printing, whereas the first Print begins printing in column 10.
  20. Line1Line2
  21. The Spanish N is ñ.
  22. Printer.Print Tab(57); "America"

Lesson 11, Unit 22


  1. The line and shape controls let you draw geometric shapes on a form.
  2. Six
  3. BorderStyle
  4. The Shape property
  5. The picture box control and the image control
  6. The image control is more efficient than the picture box control.
  7. Bitmaps, metafiles, and icons.
  8. The Shrink property
  9. The Picture property
  10. LoadPicture()
  11. Jean cannot change the line appearance for any line thicker than one twip.
  12. Jean would have to draw several smaller thick lines to create the appearance of a single dashed line.
  13. Nothing appears when the LoadPicture() function executes because of the null argument.
  14. Indicate the blue border using the BorderColor property, the red diagonal line using the FillColor property, and the green interior with the BackColor property.

Lesson 12, Unit 23


  1. 2
  2. The user can select from the scroll bar's relative position instead of typing specific values.
  3. The amount that the scroll bar values change when the user adjusts a scroll bar's value.
  4. By clicking within the shaft on either side of the scroll bar.
  5. The smallest and largest values that a scroll bar can represent.
  6. hsb and vsb are the preferred naming prefixes.
  7. True
  8. Make sure that the grid's custom control file is added to the project.
  9. GRID.VBX
  10. False
  11. One of the individual row and column intersection locations inside a grid.
  12. False
  13. When the grid's size is not large enough to display the full grid.
  14. Row and Col
  15. SelEndCol, SelEndRow, SelStartCol, and SelEndCol
  16. 12
  17. MousePointer
  18. The caret
  19. The cursor
  20. When a control's default MousePointer property is not the arrow. This typically occurs only for custom controls.
  21. The hourglass
  22. Through event procedure arguments
  23. True
  24. The number of fixed rows and fixed columns must be no more than two fewer than the total number of rows and columns. You will have to change the grid's Enabled property to False if you don't want the user to have any additional control over a grid.
  25. Min: 32, Max: 212, SmallChange: 3, LargeChange: 8

Lesson 12, Unit 24


  1. Logic and syntax errors
  2. Syntax error
  3. A debugger is an online tool that lets you hunt down errors (bugs) in a program.
  4. Use the Options Environment command to request interactive syntax checking.
  5. True
  6. False
  7. Syntax errors are easier than logic errors to find.
  8. Design mode, run mode, and break mode
  9. Design mode
  10. Look at Visual Basic's title bar to see the name of the current mode.
  11. Break mode
  12. Press Ctrl+Break, Select from the Run menu, click the break button on the toolbar, or set a breakpoint
  13. A specific line that Visual Basic halts execution at during a program's run.
  14. By highlighting the line of code and pressing F9, clicking on the toolbar, or by selecting from the Debug menu
  15. Visual Basic highlights the breakpoint line
  16. When Visual Basic reaches a breakpoint, Visual Basic halts the program's run before the breakpoint line executes.
  17. Executing a program one line at a time, controllable by yourself instead of by Visual Basic.
  18. The single footprint requests that Visual Basic single step through every line of code and the double footprint requests that Visual Basic single step through the breakpoint's current procedure but not single step through procedures called by the current procedure.
  19. From the Instant Watch dialog box, you can look at variables and control values. From the Add Watch dialog box, you can request that Visual Basic enter a break mode when a certain expression becomes true or when a certain value is changed.
  20. The Instant Watch is most handy for looking at variables during a breakpoint.
  21. The Debug window
  22. The Print method
  23. The assignment statement
  24. Jennifer must precede her Print methods with the Debug object.

Previous 
Page Page Top TOC