Main Form functions in separate files?

  • Thread starter Thread starter Jon Gabel
  • Start date Start date
J

Jon Gabel

Newbie question: I would like to place some functions in the class
MainForm in several files besides Form1.cs. Is there a way to do this?

JG
 
2.0 framework allows for parts of classes to be decalred in seperate .cs files. I don't think there is any way to do this in the
1.* frameworks.

A work-around is to use an entirely seperate class that the MainForm can access. This will effectively allow you to write interface
code in a much 'cleaner' environment, while seperating anything deemed as 'business logic' code in a seperate class. You can also
add the 'business logic' or 'utility' code into a seperate assembly or "component library" altogether and reuse it for other
projects.
 
Back
Top