Creating Classes & ActiveX Controls

Introduction

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.

You might also like...

Comments

About the author

James Crowley

James Crowley United Kingdom

James first started this website when learning Visual Basic back in 1999 whilst studying his GCSEs. The site grew steadily over the years while being run as a hobby - to a regular monthly audien...

Interested in writing for us? Find out more.

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“The most exciting phrase to hear in science, the one that heralds new discoveries, is not 'Eureka!' but 'That's funny...'” - Isaac Asimov