Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5992159
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T23:29:29+00:00 2026-05-22T23:29:29+00:00

Currently, if I have different classes containing functions etc, I would structure them all

  • 0

Currently, if I have different classes containing functions etc, I would structure them all in the 1 VB file titled whatever the main Class is. For example:

MainClass.vb:

Class MainClass

     Function FunctionA() as String
        ...
     End Function

     Class SubClass

          Function SubFunction() as String
              ....
          End Function

          Class SubSubClass

               ......

          End Class

      End Class

End Class

However, the problem with this is the file can become 1000s of lines long making hard to find portions of code.

Is there a way I can store SubClass in a file such as MainClass.SubClass.vb so that its easier to locate classes? Or is there a better, more standard, way of doing this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T23:29:30+00:00Added an answer on May 22, 2026 at 11:29 pm

    At least C# understands “partial classes” where you can spread the code over multiple files (within the same assembly)

    EDIT
    I expected VB to have partial classes also (I only work in C# myself), but as noted in the comments, it does have them.

    In C# I could code something like this:

    File MainClass.cs:

    public partial class MainClass  // note the "partial" keyword
    {
       // some method declarations etc.
    }
    

    File MainClass.SubClass.cs:

    public partial class MainClass // have to repeat this to hook up correctly
     // but an "Implements" or "Extends" could be different
    {
       // maybe some other methods
    
       private class SubClass
       {
          // etc.
       }
    }
    

    But the real question is: do those subclasses really need to be inner classes of that “MainClass”, or could they be top-level classes themselves?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Currently I'm finding I have to keep duplicating partials for different modules. I would
I have 2 Lists of 2 different classes. We can call them Foo and
I currently have all my models (Schema definitions) in the /models/models.js file for my
I currently have a site where different users can login, and depending on their
We currently have developed an application using WCF. Our clients make connections to different
Background Currently, I am working on a Rails application. I have different products that
I have an internal enterprise app that currently consumes 10 different web services. They're
We currently have quite a few classes in a project, and each of those
I have two different classes that share a common interface. Although the functionality is
I would like to automate my Android project building with Ant. Currently I have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.