Using Example Code from Online Help
You can copy example code from online Help, paste it into the current Code window Code examples are provided in the Programming Language , Properties , and Events topics., and then edit the code to fit your needs.
To copy and paste example code from Help into your code
1. Find the topic you want.
2. Click the word Example in the non-scrolling region of the topic to jump to the code sample.
3. In the secondary window that contains the code sample, choose Copy.
4. In the Copy window, select the code you want to copy to the Code window and choose the Copy button.
5. In the Code window, click where you want to insert the example code.
6. From Visual Basic's Edit menu, choose Paste (Ctrl+V).
Note After copying example code from Help, you may need to modify variables, constants, and references to form and control names to fit your application. Be sure that you add an apostrophe ( ' ) at the beginning of each comment, especially if it wraps to a second line. Failure to do so may prevent the code from executing.
Guidelines for Entering and Editing Code
Replacing Text in Code
Chapter 1, "Introduction"