From the course: Visual Basic Essential Training

Unlock this course with a free trial

Join today to access over 24,500 courses taught by industry experts.

Add procedures to a module

Add procedures to a module

- [Instructor] Procedures are declared in modules or classes. We'll look at how to add subs and functions to our application. Both are useful, but for this chapter we'll focus primarily on functions. We'll also discuss why most of the code belongs in a class. We'll look at how to add a module. To review what we've seen, a module is a container for shared code, often used as global functions or consonants that don't belong to a specific object. It's like a toolbox that any code in our program can access. The way I would add a module to my project, I would right click on it and choose add, and then you can go to the new item, that'll take you to this dialogue, add new item, and then you can search for what you're looking for here, in this case module. What I prefer to do is to right click and choose add and then scroll down this list to this section. So I can add a module or a class. So I'll click here. Then I give my module a name and then click on add. Now I've already done that. I've…

Contents