So, I just started developing C # WinForm applications, and every project I worked on seems to be larger and requires more user-defined functions. If I add all the functionality to one form, it is obvious that it can get out of hand very quickly. In my last project, I would separate the functionality into separate Forms, and whenever someone said that they wanted to execute “Feature1”, I would create an instance of Feature1 Form and show it as a dialog with the main form as its owner (therefore they don’t could click on it).
I'm just wondering what other methods exist to store code organized in Forms. If you have to have tons of functions in one form, is there a good way to keep elements organized? I just hate having a code file with a length of hundreds / thousands of lines.
The answer may simply be in design, try creating an interface before you can use multiple forms?
Another example that I came across. I created a Tab control and had about 5 tabs. These 5 tabs had many features and were saved in the same CS file. What were my other options? Create a new custom TabControl class with my specific functionality for this tab?
I do not mind reading, so if there are decent articles, feel free to link them!
source
share