Use the Editor


[Page 609 (continued)]

  1. Select (or highlight) text as a block.

     

    1.

    Move the cursor to the beginning or end of the text.

    2.

    Hold down a Shift key and use the direction keys to highlight a block of text.

    3.

    Release the Shift key.

    or

     

    1.

    Move the mouse to the beginning or end of the text.

    2.

    Hold down the left mouse button and move the mouse to the other end of the text.

    3.

    Release the left mouse button.

    Note 1: To de-select text, press the Esc key or click outside the text.

    Note 2: To select a word, double-click on it. To select a line, move the mouse pointer just far enough into the left margin so that the pointer changes to an arrow, and then single-click there.

  2. Delete a line of a program.

     

    1.

    Mark the line as a block. (See item A of this section.)

    2.

    Press Alt/E/T, or press Ctrl + X.

    Note: In the preceding maneuver, the line is placed in the clipboard and can be retrieved by pressing Ctrl + V. To delete the line without placing it in the clipboard, mark it as a block, and press the Delete key.

  3. Move a line within the Code window.

     

    1.

    Mark the line as a block, and drag it to the new location with the mouse.


  4. [Page 610]
  5. Use the Clipboard to move or duplicate statements.

     

    1.

    Mark the statements as a block.

    2.

    Press Ctrl + X to delete the block and place it into the clipboard, or press Ctrl + C to place a copy of the block into the clipboard.

    3.

    Move the cursor to the location where you desire to place the block.

    4.

    Press Ctrl + V to place a copy of the text from the clipboard at the cursor position.

  6. Search for specific text in the program.

     

    1.

    Press Alt/E/F or Ctrl + F.

    2.

    Type the sought-after text into the "Find what:" rectangle. (Alternatively, press the down-arrow button on the right side of the rectangle to select from a list of the text items most recently searched for.)

    3.

    If you would like to specify certain search options, such as "Match case," click on the plus button to the left of "Find Options."

    4.

    Press the Find Next button.

    5.

    To repeat the search, press F3.

  7. Find and Replace.

     

    1.

    Press Alt/E/R or Ctrl + H.

    2.

    Type the text to be replaced into the "Find what:" rectangle. (Alternatively, press the down-arrow button on the right side of the rectangle to select from a list of the text items most recently searched for.)

    3.

    Type the replacement text into the "Replace with:" rectangle. (Alternatively, press the down-arrow button on the right side of the rectangle to select from a list of the text items most recently used as replacements.)

    4.

    If you would like to specify certain search options, such as "Match case," click on the plus button to the left of "Find Options."

    5.

    Press either the "Replace All" button to replace all occurrences of the text to be replaced, or press "Find Next" to highlight the first occurrence of the text to be replaced. With the second option, either click "Replace" to replace the highlighted text, or press "Find Next" to highlight (and possibly replace) the next occurrence of the sought-after text.

  8. Undo a change to the code.

     

    1.

    Press Alt/E/U or Ctrl + Z to undo the last change made.

    Note: If desired, an undone change can be redone by pressing Ctrl + Y

  9. Turn off the IntelliSense feature.

     

    1.

    Press Alt/T/O.

    2.

    If the check box to the left of "Show all settings" is unchecked, check it.

    3.

    In the left pane, expand "Text Editor."

    4.

    Expand the subheading "Basic."

    5.

    Click on the subtopic "General."

    6.

    Ensure that all the check boxes under the "Statement Completion" heading are unchecked.


  10. [Page 611]
  11. Wrap words to the next line in the Code editor rather than having a horizontal scrollbar.

     

    1.

    Follow steps 1 through 5 of part H above.

    2.

    In the right pane, place a check mark in the check box labeled "Word Wrap."

  12. Hide a long procedure.

     

    1.

    Scroll to the top of the procedure.

    2.

    Click on the box with a minus sign in it that is to the left of the header of the procedure. (Notice that the box now contains a plus sign and that the entire procedure is hidden on the one line. Click on the box again to show the procedure.)

  13. Add a collapsible region.

     

    1.

    Type #Region "regionName" on the line before the code to be included in the region.

    2.

    Type #End Region on the line after the last line of code in the region.

    3.

    The region of code can then be collapsed by clicking on the minus box and restored by clicking on the plus box.

    Note: A region cannot be defined within a Function or Sub procedure.

  14. Instruct the editor to indent by two spaces.

     

    1.

    Follow steps 1 through 4 of part H.

    2.

    Click on the subtopic "Tabs."

    3.

    In the right pane, change the number in the "Indent Size:" text box to 2.




An Introduction to Programming Using Visual Basic 2005
Introduction to Programming Using Visual Basic 2005, An (6th Edition)
ISBN: 0130306541
EAN: 2147483647
Year: 2006
Pages: 164

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net