From the course: Visual Basic Essential Training

Unlock the full course today

Join today to access over 22,400 courses taught by industry experts or purchase this course individually.

Code containers: Modules and classes

Code containers: Modules and classes - Visual Basic Tutorial

From the course: Visual Basic Essential Training

Start my 1-month free trial

Code containers: Modules and classes

- [Instructor] It's time to write some visual basic code, often called VB code, so I'll write that in notepad. Here are some essential rules to follow. All VB code must live inside a container. The three containers I'll demonstrate are modules, classes, and structures. To create a module, type the word module. And then the VB has a rule that says you have to give the container a name, so I'll call this one FirstModule. Then move down a line or two, and you will end this section of code, this container, with the word End, and then the type of container that you're closing. So I'll type in End Module. Now I'll do the same thing with a class. I'll type in Class, the name of the class, go down a line or two, and End the class. Finally I'll make a structure, and I'll end it, the same way we ended the other ones with the word End, and then the thing that I'm closing, the container that I'm closing, like that. Save the…

Contents