A lot of code on one form when using tab folders. Any solutions?

Hi, I am using VB.NET 2005. I have a fairly large program and have broken it up into tab folders. I would like each tab to have a seprate form in order to isolate the code associated with each tab. I notice that the way VB.NET uses tabs, all of the code is on one form which makes finding code segments messy. Is there a way to fix this, or do I have to live with it. I am using modules extensively to reduce the amount of code on the form.

Any suggestions would be helpful,.

Thanks, quicksun



Answer this question

A lot of code on one form when using tab folders. Any solutions?

  • ObieOne

    You could add a Code file and then put the code in functions or subs and just call the function or sub from the tab control.
  • TrevNet

    I think what he means is to keep the functionality of your program seperate from the UI code (form Code). That is to create a seperate .cs file with your classes and methods. This is also good practice from an OOP point of view and makes your code more manageable. I apologise if this sounds C#'ish i have no idea about VB.net

    Regards


  • GunsmanJoe

    Thanks Foldip, I haven't made a user control yet, but your solution sounds promising. I'll give it a shot.

    quicksun


  • Tom Lake

    Thanks Expressman, I don't know what you mean when you say "Code File" I am making extensive use of modules and functions, in order to reduce the code on the form. What more can I do in this regard

    quicksun


  • JustLearninC#

    Thanks Paul. Between your suggestion and the others, I think I have a roadmap to follow. Thanks for the help.

    quicksun


  • Aakarsh

    I think a common solution is to make user controls in this situation. You can make user controls for each tabpage, and enclose the functionality in that control. This way the result will be a more flexible solution because you can anytime move a tabcontrol's funcionality for example to an other form. And your problem is solved also.
  • A lot of code on one form when using tab folders. Any solutions?