In a winforms application I have a MyForm.cs that starts to get quite large. To solve this I have created a new file(MyForm.LeftPanel.cs) using partial class of the MyForm class with a subset of the GUI functionality.
However once in a while, not always, when I go into the designer all event handlers that I have moved to MyForm.LeftPanel.cs gets regenerated in MyForm.cs with empty functions. This obviously causes compiler error until I manually remove them in MyForm.cs.
How can I prevent these functions from being regenerated?
I saw a question about Placing these kind of files under the main.cs in the project, could this be the solution that would tell visual-studio to find the existing functions?