What are classes and controls? A control is something you put on a form, with methods (procedures and functions), properties, constants, and events. A class is basically the same, except you can't place it on a form, or set its properties at design-time.
Why should we use them? If you have a large project, have lots of people working on a project, or have a large number of little projects, you will find that there are portions of code that you are using over and over again. You will also find that you don't want co-programmers changing core parts of your project, which mean that you have to change hundreds of other lines of code too! Using classes and controls, you can break a project up into small, manageable portions. Controls and classes can also be compiled into DLL's or OCX controls, so people can use your code without seeing what is actually behind it, just like when you use the standard Microsoft controls. This is what VB web does when creating its free (and in this case, open source) controls and DLLs.
Comments