Search code examples
c#winformsduplicatesdesigner

Copy full Form in Designer in valid way (Visual C# Net 2)


I try to duplicate a form in my Designer with all the elements on it, that i have not to do the huge Job again of designing the full form again. I need only a few little changes on this form copy to do, so i do not want to design the same again from new. If i click on the form "copy" and then do "paste" on my Project the full Project is destroyed forever and a lot of error Messages Pop up about the form copy. I had to throw my Project afterwards since there's no undo of that action possible. Since this was a huge loss of work I decided to ask the question:

How do I valid copy/duplicate an existing form in the designer without errors afterwards appearing?


Solution

  • You should duplicate the form file, then change the class name in the copy in both the .cs and the .Designer.cs files.