Class inheritance / libraries

DaBomb

Member
Joined
Oct 13, 2007
Messages
5
Programming Experience
1-3
Ok. I have a project with a couple of classes that are custom controls. (One is a checkbox that changes color, for instance)
Now I have other projects that I want to use the ColorCheckBox in, without just copy/pasting the code into them. How can I have my other forms implement/import/use instances of/whatever action you want to call it, my colorcheckbox?
How can I create a library of these custom classes that I want to use in other places? I know (or think I know) that vb standard edition can do this, but how can I in express?
 
You do it in VB Express the same way you do it in any other version of VS. Create a Windows Control Library project, which is the same as a Class Library but has a couple of extra references (System.Windows.Forms, System.Drawing) by default. Now add your classes to this project. Now compile the project. Voila! Now any other project can reference that DLL the same way as any other .NET assembly. You can also add the controls it contains to your Toolbox so they can be added to other forms the same way as any other control. When you add a control to a form the project automatically creates the references it needs.
 
Back
Top