[Solved] The name '<name>' is already in use by anothe
Posted 12 October 2012 - 03:25 PM
Hello, I'm working on a Windows Forms program in VB .NET for my college coursework. To reduce duplication of code I've moved some things to custom controls to be used in multiple forms. One of these controls, called CustomerSelector, is in use by two different forms and I'm trying to give them the same name in each form. But VB gives me a "Property value is not valid" error with the message "The name ctlCustomerSelector is already in use by another component". Why am I getting this error when the custom controls should be members of different classes. It's doubly confusing because I have another custom control which is in use by two different forms with the same name in each form, and I don't get this error.
This post has been edited by Coding in the name of: 13 October 2012 - 05:07 AM
Re: [Solved] The name '<name>' is already in use by anothe
Posted 12 October 2012 - 04:58 PM
In the property windows of the offending form, click on the dropdown and look through see if you can find ctlCustomerSelector because VS apparently has found it somewhere in that form. Maybe you inadvertently dropped it in a panel or something that's not readily visible to you.
You could also open the designer and look through it to see in what context that name already exists.
This post has been edited by CharlieMay: 12 October 2012 - 04:59 PM