I have a (problem?) where my application’s main form code is becoming quite large. Because it is the main section of the app, there are a ton of event handlers.
I really don’t want to use partial classes to separate sections of the code because I might as well just use regions then. Also partial form classes don’t show up in the designer and are in general just confusing.
Not really sure what to do to be honest. The file is around 1,000 lines of code while all my other classes are 10-150 lines each. I can’t really encapsulate the behavior in to other objects because most of the event handlers manipulate controls on the form or member variables of the class and doing so would require a lot of parameter passing and confusion.
Trying to think of a possible course of action. I really would like to encapsulate a lot of the behavior in to other classes but the problem is the event handlers modify private controls and member variables. These classes would need to somehow have access to this data but I’d rather not just give an instance of the form to the class and make all the controls and member data public >.>
Any ideas?
1 Answer