Library tutorials & articles
Creating Classes & ActiveX Controls
- Introduction
- Using classes and controls
- Creating a class
- Creating a control
- Variables and Properties
- Mapping your controls' properties onto other contr
- Specifying when properties can be set and read
- Specifying default values for properties
- Saving and reading properties
- Hiding Properties at Design Time
- Methods
- Constants and Enums
- Adding Descriptions
- Conclusion
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.
Related articles
Related discussion
-
Problem with migration to C# (CoCreateInstanceEx)
by LRollison (1 replies)
-
VB6 Problem Creating Shortcuts
by rb1177 (0 replies)
-
how can i open a file
by kyawswarhtun (0 replies)
-
how to save any one form what i want?
by blackguy (5 replies)
-
Build an MP3 Player
by soybees (4 replies)
Related podcasts
-
Christian Beauclair
14 mai 2008 (�mission #0074) ::.Christian Beauclair: Stratégies de migration VB6 vers .NET Nous discutons avec Christian Beauclair des stratégies de migration VB6 vers .NET. Entre autres, nous discutons comment utiliser le "VB 6 Code Advisor" et le "Interop Forms Toolkit" pour ajouter la puiss...
Is it possible for a dll to use an ocx and its methods? How do I declare it?
thanks!!! a great help for developers.
--all glory to my great provider...--
Of all the books and tutorials I've read on classes & activeX,this should be the best.Thanx to the author.
I am fairly new at coding in VB and love diving in. I am working on a project on reading binary files, parsing bit data information and creating a display from some function of bits. The first couple of words will tell me how to set up a window and other parameters. Since my first run at creating this program, I have since discovered the use of classes as separate modules. I'm trying to create a couple of classes, one for setting of the parameters and the other for program settings. Using the Property of Let & Get has worked great and makes the management of what I am doing easier. But I have a couple of questions regarding of how to try to pass arrays like I would the other values.
For example, recalling a list of last opened file names and making them available to other modules, I had wanted to try to put it in a class like the other properties, but when I don't know if and how many how do I do that?
This thread is for discussions of Creating Classes & ActiveX Controls.