Link to home
Start Free TrialLog in
Avatar of tejicles
tejicles

asked on

How do I split .Net 4.0 Windows Form event handlers into separate files?

I am using Visual Basic for a Windows Forms project at work in Visual Studio 2010, using the .Net Framework 4. Without going into too much unnecessary detail (because my question is more theoretical), my main Windows Form is becoming unwieldy at its current size. I have a number of tabs on this form. In the interest of sticking as close to an Model-View-Controller design as possible, I would like to create a separate form for each tab, which I have already done. The problem is that the only way I know how to do that is to make each file a partial part of  the same class. This is better, but not necessarily any more maintainable, because there is no file scope that I am aware of. I want to limit the scope of each of the variables used in each tab to that file. Is there any facility in Visual Basic for what I am talking about? I have a workable version now, but, in the interest of maintainability, I would like to find a solution to this if I can. Thank you in advance for your responses
ASKER CERTIFIED SOLUTION
Avatar of Craig Wagner
Craig Wagner
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of tejicles
tejicles

ASKER

Perfect answer. Thank you for your detailed solution.