• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 233
  • Last Modified:

I need to "hide" text in a class definition

Folks:

I am new to VB.net.  I have experience in C++.

I have a class module (call it a.vb) that contains all the code necessary for a class I have designed.  It actually works.  (Scary)  My issue is, this class contains a lot of private stuff - enums, structures, variables, interfaced to legacy DLLs, etc.  I always code private data before any functions or procedures; and I always code New() first.  In this particular case, new is around line 800.  This is annoying.

I want to do one of two things -
1)  Move all the junk to another file and #include it.  (Excuse my C.)

2)  The IDE has methods of collapsing definitions of procedures etc.  Is there a way to define a section - such that everything between the section and end section will collapse?

Answers to eather question will be appreciated.  I'll split points if I get good answers to both.  Also, if there is a third possibility - let me know.  As I said - I am new and want to learn the new tricks.

Thanks  
0
jflanner
Asked:
jflanner
  • 2
1 Solution
 
gregoryyoungCommented:
#region foo
//code
#end region



you can put the code into a seperate class easily, if they are in the same namespace there is no need to #include.

namespace foo
    friend class bar
         public static test as integer
    end class
end namespace

namespace foo
    public class t
         public function get foo as integer
                return bar.test
         end function
    end class
end namespace
0
 
gregoryyoungCommented:
sorry its ...

#Region " You region name"
#End Region
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now