Click here to Skip to main content
15,887,839 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hello everyone, i have an big problem... i am writing a project with multiple forms...
and i have a admin.cs with 2 childs : Admin.desighner.cs and admin.resx .. so, when i click in an button this form show up.. but when i click in another button i need to show same form but without some extras.. (i should not use visibile, or disable/enable class) , so i copy paste this windows form in same project but with other name, for example admin1.cs... when i compile it says :

error MSB3105: The item "......../.admin.resources" was specified more than once in the "Resources" parameter. Duplicate items are not supported by the "Resources" parameter.

please help me how can i solve this... bcos if i dont do i need to write so much codes.. just i need to make same form like "admin" but i will delete some functions.. thank you so much
Posted
Updated 5-Aug-20 15:42pm

1 solution

Instead of copy/pasting the form in the solution explorer, the better thing to do is to create a new blank form and copy/paste all the controls from the first form to the new one.

This way it doesn't duplicate resources or try to use resources from a different file. You can also copy/paste the event handlers or any back-end code in the form directly, although you will have to re-wire the event handlers to the proper methods.

[Edit]

Although the above is a good way to duplicate a form, it still presents something you want to avoid as a programmer, code duplication. You should be using a single form and the enable/visible to change functionality. This reduces code complexity and duplication of work. You should review the reason you can't use that and try to find a reason to use the same form except just change things around to suit the new role.
 
Share this answer
 
v2
Comments
Emin Kokalari 25-Nov-13 18:49pm    
U saved my life... :D Thank you so so much bro !

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900