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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top