Windows Develop Bookmark and Share   
 index > Windows Forms Designer > An item with the same key has already been added
 

An item with the same key has already been added

Hi All,

I added a toolstrip control into my application main form. And then I added a toolstripbutton to the toolstrip. Right clicked on the toolstripbutton and clicked on the properties to display the properties for the button. I clicked on the dropdown button of the Image property (so that I can change the image property from the system.drawing.bitmap to a toolbar icon that I already loaded into the resource file) and immediately, Igot the following error message popup on the VS2005 IDE desktop:

An item with the same key has already been added.

What is wrong with the VS2006 IDE? I thought this is a bug that already fixed in VS2005 beta2....

Is there a way to work around this problem?

Thanks.

David N_2  Monday, May 15, 2006 1:10 AM

There is no such product as VS2006.

Check the generated code for the form and see if there exists any use of the bitmap you added already.

Phil Wright
http://www.componentfactory.com
Free user interface controls for .NET2

Philip Wright  Tuesday, May 16, 2006 12:43 PM

 

Thanks for the correction.  It should be VS2005, instead of VS2006.  The generated code is fine.  However, somehow my project has two resources.resx files. 

Thanks for the tip that helps me to locate the problem.

 

Regards

 

 

David N_2  Friday, May 19, 2006 7:40 AM

David,

Did you ever get to the bottom of this problem? I am getting, what sounds like, the exact same thing as you. The moment I click on the Image Property ellipsis, I get the same error message. I don't get chance to pick another image. To work around it I'm having to add to the resource file manually then set the property in the designer code myself.

So, I can get around it but it would be nice to know what this is.

Cheers,

~swg

swg  Monday, October 16, 2006 12:28 PM

In my case,my projecthas two resource files. I only have to delete one resource file, and it works.

David N_2  Monday, October 16, 2006 10:37 PM
I too had this problem.

In my case I only had one resource file. My solution was to delete the resource file and reconstitute it.

Iain
Iain Downs
  • Proposed As Answer byIainDowns2 Sunday, May 10, 2009 9:44 AM
  •  
IainDowns2  Sunday, May 10, 2009 9:44 AM

You can use google to search for other answers

Custom Search

More Threads

• Horizontal tabs (buttons) on left side
• Drawing over a user control
• Component not remembering property input
• Designer does not generate content code for object value
• How to make designer not to change anything in existing InitializeComponent method (designer code) ???
• Bug, anchored control on inherited form, System.Windows.Forms
• Setting Colors By Reference
• How do I find out location of toolstrip in VB.NET 2005
• How to reorder/swap tabpage in runtime
• Windows Form Resizing !