Sunday, February 8, 2009

Control Library is more Useful than ClassLibrary

A ClassLibrary project and a UserControl project are not much different. Each can contain user controls and forms. There was a reference to a problem with using user controls in a class library.

There is also a reference to a problem with using a control library and a class library. I also had a problem with this, since each one referred to the other; after doing a clean, I was unable to rebuild.

The only differences I have observed are some different references. The class library has a reference to System.Linq.

I will stick to a user control library and add general classes to it, too.

As for visual inheritance of a form in the library, the controls that have protected access will also be set in the InitalizeComponent of the child, so the child can change them; private controls will not be referenced in the child.

The components container in the child class will not be instantiated until a control or component is added to the child form.

I have been modifying a base form and adding child forms based on it. After I have added a child by creating an inherited class, then made changes to the base and then added another child by creating an inherited class, there can be a reference error when adding the second child; resolve this by cleaning the solution, rebuilding the control library and rebuilding the solution.

No comments:

Post a Comment

Followers