0

I've created a win form application which consist of a single form. We have 8 tabs to access the modules of application.

The problem is we are a team of 4 who works on this project. But since it is a single form application, only one person can use the file at a time. Is there anyother way to build application with more than one file?

Please provide some solution.

Vijaychandar
  • 716
  • 5
  • 21

4 Answers4

2

Firstly, you should probably have a separate UserControl per tab. That will give you 8 files (at least) since you have 8 tabs.

Secondly, you should be using a Model-View-Controller style architecture for Windows Forms applications. That will give you at least one controller, but likely you will have one controller per UserControl (i.e. per tab). You might even have an overall controller that manages the per-tab controllers.

You might only have one data model for the entire app, or you might have one data model per UserControl (tab).

If you did all that, you'd have a few more source files.

However, it's actually difficult to say without knowing anything about your app.

Matthew Watson
  • 104,400
  • 10
  • 158
  • 276
1

Try using user controls to make each tab modular.

Figure out what are the parameters that each tab accepts and that it exposes and then create user controls that have that behavior.

Here are couple resources to get you started

http://msdn.microsoft.com/en-us/library/aa302342.aspx

User Control vs. Windows Form

User Controls in Windows Forms - Anything similar to ASP.NET User Controls?

Community
  • 1
  • 1
Igor Voplov
  • 973
  • 9
  • 7
1

Even if this is a giant ball of wax, your source control tools are shoddy and breaking it up into separate classes is hard to do, you can still take advantage of a Form class being a partial class. Which means that you can spread the code over any number of source code files, not just the two files that the designer creates. So a logical organization is to move code that belongs to a particular tab in its own partial class with the same form class name and its own source code file. Some cut+paste required however when you add event handlers with the designer.

Hans Passant
  • 922,412
  • 146
  • 1,693
  • 2,536
0

Have you considered using MDI?

MSDN Working with MDI...

Examples are in VB.Net but I'm sure it will be easy to use C# if you really want to - I'm not sure why, but... :)

rheitzman
  • 2,247
  • 3
  • 20
  • 36