How To: Manage Procedures


[Page 618]

  1. Access the Code window.

     

    1.

    Press Alt/V/C or F7.

    or

     

    1.

    Press Alt/V/P to activate the Solution Explorer window.

    2.

    Select the file formName.vb.

    3.

    Click on the View Code button.

  2. Create a general procedure.

     

    1.

    Access the Code window.

    2.

    Move to a blank line that is not inside a procedure.

    3.

    Type "Sub" (for a Sub procedure) or "Function" (for a Function procedure) followed by the name of the procedure and any parameters.

    4.

    Press the Enter key. (The Code window will now display the new procedure heading and an End Sub or End Function statement.)

    5.

    Type the body of the procedure into the Code window.

  3. Create an event procedure.

     

    1.

    Access the Code window.

    2.

    Click on the down-arrow at the right of the Class Name box, and then select an object.

    3.

    Click on the down-arrow at the right of the Method Name box, and then select an event. (An empty event procedure that handles the event is created.)

  4. Alter a procedure.

     

    1.

    View the procedure in the Code window.

    2.

    Make changes as needed.

  5. Remove a procedure.

     

    1.

    Bring the procedure into the Code window.

    2.

    Mark the entire procedure as a block.

    3.

    Press the Delete key.

  6. Insert an existing procedure into a program.

     

    1.

    Open the program containing the procedure.

    2.

    View the procedure in the Code window.

    3.

    Mark the entire procedure as a block.

    4.

    Press Ctrl + C to place the procedure into the clipboard.

    5.

    Open the program in which the procedure is to be inserted, and access the Code window.

    6.

    Move the cursor to a blank line.

    7.

    Press Ctrl + V to place the contents of the clipboard into the program.




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