Custom Control Library Problems

rustyd

Well-known member
Joined
Mar 5, 2003
Messages
112
I created a control library with 7 custom properties. I have a test form project in the same solution as the control library project. I can add a control to the test form and it works great. My custom properties are displayed in the properties window when the control is selected. I can change the properties of the control in the properties window fine also.

When I reference the control library in another solution, I can add a control from the control library to a form no problem. When I run the program it auto saves, removing the asterick by filename, and then the .vb files (code and form) show the asterick again and the .vb file with the form on it changes to a red x with the following message:
An error occurred while loading the document. Fix the error and then try loading the document again. The error message follows: The designer cannot be modified at this time.

Has anyone else experienced this?
 
Nevermind. I added the control library to the toolbox so my controls would show up there. I made some changes to the control library, removed the controls from the test form and plopped on a new control from the toolbox, which was referencing and older build of the control library. Is this possible? If thats the case, and it avoids DLL hell, does that mean there is a DLL hell2 where you think youre referencing a new build, but instead, the designer is referencing the old build?

Anyway, by removing the reference in the toolbox and re-adding from the new build of the control library, everything worked fine.
 
Ive never encountered this behaviour when referencing a control library thats compiled in to a DLL.

When Im developing controls I have one solution with both the control library and a test project, and the designer automatically puts the control library in the toolbox. However, this isnt compiled on disk, instead its referencing the dynamically compiled version kept in memory by Visual Studio. Occasionally it can forget to update this and I have to close the test project form and re-open it.
 
I have a solution with 2 projects, one is the control library and the other is a form that I use to test the controls (sounds like your setup). Youre saying your controls from the control library are automatically putting the control library controls on the toolbox? How do you do that?

I had to right click the toolbox, click customize toolbox... and click the .Net components, and select my library. I had to do this in the control library solution and the separate solution where I am referencing the control library (so I could just drag and drop the controls onto the form).

Whenever I would make a change, the changes wouldnt update the separate solution.
 
Actually come to think of it, that is what I had to do. I was thinking of testing a control in a form in the same project as the control. I did have to add the control to the toolbox in the test project, from the compiled version.

The problem youre having may be because the build order of your projects isnt right. You need to right-click your solution node and choose Project Dependancies. You have to indicate that your test application is dependant on your control library so the control library gets built first.
 
I checked the build order and the component library is built before. My test project has the component library in the Depends On list and is checked. The component library has the test project in the Depends On list and is not checked.
 
Back
Top