jmasson Posted October 3, 2003 Posted October 3, 2003 I am running VB .net standard edition. I have created a usercontrol called "PlusMinus". After first compile, it appears fine in my toolbox. But when I add one to my main "ToolManager" form, Windows Form Designer insists on putting them as "ToolManager.PlusMinus" which results in an error of "Type 'ToolManager.PlusMinus" is not defined.". If i'm lucky, I can just change the Windows Form Designer code to define them as simply "PlusMinus", rempving the "ToolManager." part. This will usually solve the problem for a while. But if i move ANY other controls around, or make changes to the PlusMinus usercontrol, the this error comes back. If I'm unlucky, my usercontrols disappear entirely and I have to re-add them, and then hack the code as described above. This is getting VERY annoying. Am I doing something wrong? I made the usercontrol right in same project as main form. I cannot find a way to add a referce to the usercontrol or to add it to "imports" declaration. Doesnt seem to exist anywhere. Even tried "imports PlusMinus" and it didnt seem to help. I would just make a dll or something out of the usercontrol, but of course I can't (Can I?) with standard edition. PLEASE HELP! Quote
AndreRyan Posted October 4, 2003 Posted October 4, 2003 You need to put the control in a seperate DLL file to remove this error, VS.Net doesn't like it when the control is in the the same project, probably something to do with the debug system. Just add a DLL project, attach it to your current solution and add a reference to the DLL project within your primary project(Right Click References[in Solution Explorer]>Add Reference). Quote .Net allows software to be written for any version of Windows and not break like Unmanaged applications unless using Unmanaged procedures like APIs. If your program uses large amounts of memory but releases it when something else needs it, then what's the problem?
*Gurus* divil Posted October 6, 2003 *Gurus* Posted October 6, 2003 Visual Studio copes fine with a control in the same project, on my machine. The problem is likely caused by the fact that his form is called ToolManager and his root namespace is the same. Therefore the generated code won't be valid. Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
jmasson Posted October 6, 2003 Author Posted October 6, 2003 AndreRyan: I am using STANDARD edition. This does not allow me to make DLL projects! divil: Ok, fair enough. What to change where? I'm a little unlclear. Quote
AndreRyan Posted October 7, 2003 Posted October 7, 2003 Change the name of the form to something other than the project name or vice versa. Divil: I'm using the Academic version and have a problem with controls in the same project but I put the controls in a DLL project and the errors stopped, the designer seems to want all the controls to be compiled before they are used. Quote .Net allows software to be written for any version of Windows and not break like Unmanaged applications unless using Unmanaged procedures like APIs. If your program uses large amounts of memory but releases it when something else needs it, then what's the problem?
jmasson Posted October 7, 2003 Author Posted October 7, 2003 thanks Excellent! works now, thanks a lot. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.